PHPDaemon\FS\FileWatcher::__construct PHP Method

__construct() public method

Constructor
public __construct ( )
    public function __construct()
    {
        if (Daemon::loadModuleIfAbsent('inotify')) {
            $this->inotify = inotify_init();
            stream_set_blocking($this->inotify, 0);
        }
        Timer::add(function ($event) {
            Daemon::$process->fileWatcher->watch();
            if (sizeof(Daemon::$process->fileWatcher->files) > 0) {
                $event->timeout();
            }
        }, 1000000.0 * 1, 'fileWatcher');
    }