v1.2.0
A major new feature release, see release announcement.
-
Feature: Introduce new concept of default loop with the new
Loop
class.
(#226 by @WyriHaximus, #229, #231 and #232 by @clue)The
Loop
class exists as a convenient global accessor for the event loop.
It provides all methods that exist on theLoopInterface
as static methods and
will automatically execute the loop at the end of the program:$timer = Loop::addPeriodicTimer(0.1, function () { echo 'Tick' . PHP_EOL; }); Loop::addTimer(1.0, function () use ($timer) { Loop::cancelTimer($timer); echo 'Done' . PHP_EOL; });
The explicit loop instructions are still valid and may still be useful in some applications,
especially for a transition period towards the more concise style.
TheLoop::get()
method can be used to get the currently active event loop instance.// deprecated $loop = React\EventLoop\Factory::create(); // new $loop = React\EventLoop\Loop::get();
-
Minor documentation improvements and mark legacy extensions as deprecated.
(#234 by @SimonFrings, #214 by @WyriHaximus and #233 and #235 by @nhedger) -
Improve test suite, use GitHub actions for continuous integration (CI),
update PHPUnit config and run tests on PHP 8.
(#212 and #215 by @SimonFrings and #230 by @clue)