INotifyHandler

interface OCP\Files\Notify\INotifyHandler
Provides access to detected changes in the storage by either actively listening
or getting the list of changes that happened in the background
Source:lib/public/Files/Notify/INotifyHandler.php#32

Methods

public OCP\Files\Notify\INotifyHandler::listen($callback)
Start listening for update notifications
The provided callback will be called for every incoming notification with the following parameters
- IChange|IRenameChange $change

Note that this call is blocking and will not exit on it’s own, to stop listening for notifications return `false` from the callback
Source:

lib/public/Files/Notify/INotifyHandler.php#45

Parameters:
  • $callback (callable)
Since:

12.0.0

public OCP\Files\Notify\INotifyHandler::getChanges()
Get all changes detected since the start of the notify process or the last call to getChanges
Source:lib/public/Files/Notify/INotifyHandler.php#54
Returns:\OCP\Files\Notify\IChange[]
Since:12.0.0
public OCP\Files\Notify\INotifyHandler::stop()
Stop listening for changes
Note that any pending changes will be discarded
Source:lib/public/Files/Notify/INotifyHandler.php#63
Since:12.0.0