<?php require __DIR__ . '/../vendor/autoload.php'; $loop = React\EventLoop\Factory::create(); $timer = $loop->addPeriodicTimer(0.1, function () { echo 'tick!' . PHP_EOL; }); $loop->addTimer(1.0, function () use ($loop, $timer) { $loop->cancelTimer($timer); echo 'Done' . PHP_EOL; }); $loop->run();
info at phpclasses dot org