empress-php/inotify

Non-blocking ext-inotify wrapper for Amp

0.1.0 2021-05-03 15:24 UTC

This package is auto-updated.

Last update: 2024-05-04 16:16:02 UTC


README

PHP Build Latest Stable Version Coverage Status

inotify

Non-blocking ext-inotify wrapper for Amp

Install it

composer require empress-php/inotify

Example

<?php

use Amp\Loop;
use Empress\Inotify\Inotify;

require_once __DIR__ . '/../vendor/autoload.php';

Loop::repeat(1000, function () {
    \touch(__FILE__);
});

Loop::run(function () {
    $inotify = new Inotify();
    $inotify->addWatch(__DIR__, \IN_ATTRIB);

    while ($events = yield $inotify->readEvents()) {
        \var_dump($events);
    }
});