mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
Add INotifyHandler to make notify more flexible
This commit is contained in:
parent
1bf43bf0a3
commit
8c937d6126
8 changed files with 277 additions and 20 deletions
36
src/INotifyHandler.php
Normal file
36
src/INotifyHandler.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
/**
|
||||
* @copyright Copyright (c) 2016 Robin Appelman <robin@icewind.nl>
|
||||
* This file is licensed under the Licensed under the MIT license:
|
||||
* http://opensource.org/licenses/MIT
|
||||
*
|
||||
*/
|
||||
|
||||
namespace Icewind\SMB;
|
||||
|
||||
|
||||
interface INotifyHandler {
|
||||
|
||||
/**
|
||||
* Get all changes detected since the start of the notify process or the last call to getChanges
|
||||
*
|
||||
* @return Change[]
|
||||
*/
|
||||
public function getChanges();
|
||||
|
||||
/**
|
||||
* Listen actively to all incoming changes
|
||||
*
|
||||
* Note that this is a blocking process and will cause the process to block forever if not explicitly terminated
|
||||
*
|
||||
* @param callable $callback
|
||||
*/
|
||||
public function listen($callback);
|
||||
|
||||
/**
|
||||
* Stop listening for changes
|
||||
*
|
||||
* Note that any pending changes will be discarded
|
||||
*/
|
||||
public function stop();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue