Add INotifyHandler to make notify more flexible

This commit is contained in:
Robin Appelman 2016-12-08 15:18:24 +01:00
commit 8c937d6126
8 changed files with 277 additions and 20 deletions

36
src/INotifyHandler.php Normal file
View 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();
}