|
1 | 1 | # Changelog
|
2 | 2 |
|
| 3 | +## 1.2.0 (2021-07-11) |
| 4 | + |
| 5 | +A major new feature release, see [**release announcement**](https://clue.engineering/2021/announcing-reactphp-default-loop). |
| 6 | + |
| 7 | +* Feature: Introduce new concept of default loop with the new `Loop` class. |
| 8 | + (#226 by @WyriHaximus, #229, #231 and #232 by @clue) |
| 9 | + |
| 10 | + The `Loop` class exists as a convenient global accessor for the event loop. |
| 11 | + It provides all methods that exist on the `LoopInterface` as static methods and |
| 12 | + will automatically execute the loop at the end of the program: |
| 13 | + |
| 14 | + ```php |
| 15 | + $timer = Loop::addPeriodicTimer(0.1, function () { |
| 16 | + echo 'Tick' . PHP_EOL; |
| 17 | + }); |
| 18 | + |
| 19 | + Loop::addTimer(1.0, function () use ($timer) { |
| 20 | + Loop::cancelTimer($timer); |
| 21 | + echo 'Done' . PHP_EOL; |
| 22 | + }); |
| 23 | + ``` |
| 24 | + |
| 25 | + The explicit loop instructions are still valid and may still be useful in some applications, |
| 26 | + especially for a transition period towards the more concise style. |
| 27 | + The `Loop::get()` method can be used to get the currently active event loop instance. |
| 28 | + |
| 29 | + ```php |
| 30 | + // deprecated |
| 31 | + $loop = React\EventLoop\Factory::create(); |
| 32 | + |
| 33 | + // new |
| 34 | + $loop = React\EventLoop\Loop::get(); |
| 35 | + ``` |
| 36 | + |
| 37 | +* Minor documentation improvements and mark legacy extensions as deprecated. |
| 38 | + (#234 by @SimonFrings, #214 by @WyriHaximus and #233 and #235 by @nhedger) |
| 39 | + |
| 40 | +* Improve test suite, use GitHub actions for continuous integration (CI), |
| 41 | + update PHPUnit config and run tests on PHP 8. |
| 42 | + (#212 and #215 by @SimonFrings and #230 by @clue) |
| 43 | + |
3 | 44 | ## 1.1.1 (2020-01-01)
|
4 | 45 |
|
5 | 46 | * Fix: Fix reporting connection refused errors with `ExtUvLoop` on Linux and `StreamSelectLoop` on Windows.
|
|
0 commit comments