flow-control / react-inotify
Event-driven inotify streams for non-blocking I/O in ReactPHP
Installs: 8 315
Dependents: 0
Suggesters: 0
Security: 0
Stars: 5
Watchers: 1
Forks: 1
Open Issues: 0
Requires
- php: ^8.0
- ext-inotify: *
- evenement/evenement: ^3
- react/event-loop: ^1.2
Requires (Dev)
- infection/infection: <1.0
- phpstan/phpstan: ^1.0.0
- phpunit/phpunit: ^8.5|^9.5
This package is auto-updated.
Last update: 2024-12-27 16:01:21 UTC
README
Simple, async inotify event handler build with ReactPHP
This library is heavily inspired by reactphp/stream.
Dependencies
This library depends on the PHP Inotify extension, available via PECL
$ pecl install inotify
PHP Version Support
If you are looking for PHP 7 support you need to install flow-control/react-inotify
in version 1. Version 2 dropped support for PHP 7.
Usage
Install
$ composer require flow-control/react-inotify
How to use
Create an object from the \Flowcontrol\React\Inotify\InotifyStream
class
and register your event handlers.
$inotify = new \Flowcontrol\React\Inotify\InotifyStream(); $inotify->on('event', function (array $data) { var_dump($data); }); $inotfiy->addWatch(__DIR__, IN_CLOSE_WRITE);
Tests
$ composer install
$ composer test
Build with
License
MIT, see LICENSE file.