File tree Expand file tree Collapse file tree 3 files changed +15
-5
lines changed
Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 2626 "Revolt\\ EventLoop\\ Adapter\\ React\\ " : " src"
2727 },
2828 "files" : [
29+ " src/bootstrap.php" ,
2930 " etc/Factory.php"
3031 ]
3132 },
Original file line number Diff line number Diff line change 33// This example is adapted from reactphp/event-loop, but running on Revolt's event loop.
44// https://github.com/reactphp/event-loop/blob/85a0b7c0e35a47387a61d2ba8a772a7855b6af86/examples/01-timers.php
55
6- use Revolt \EventLoop \Adapter \ React \ RevoltLoop ;
6+ use React \EventLoop \Loop ;
77
88require __DIR__ . '/../vendor/autoload.php ' ;
99
10- $ loop = RevoltLoop ::get ();
10+ echo ' Running with the following event loop: ' , \get_class (Loop ::get ()), PHP_EOL ;
1111
12- $ loop -> addTimer (0.8 , function () {
12+ Loop:: addTimer (0.8 , function () {
1313 echo 'world! ' . PHP_EOL ;
1414});
1515
16- $ loop -> addTimer (0.3 , function () {
16+ Loop:: addTimer (0.3 , function () {
1717 echo 'hello ' ;
1818});
1919
20- $ loop -> run ();
20+ Loop:: run ();
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use React \EventLoop \Loop ;
4+ use Revolt \EventLoop \Adapter \React \RevoltLoop ;
5+
6+ /**
7+ * @psalm-suppress InternalMethod
8+ */
9+ Loop::set (RevoltLoop::get ());
You can’t perform that action at this time.
0 commit comments