Skip to content

Commit

Permalink
Forward compatibility with react/event-loop 1.0 and 0.5 while still s…
Browse files Browse the repository at this point in the history
…upporting 0.4
  • Loading branch information
WyriHaximus committed Apr 9, 2018
1 parent f423c2a commit ed2e785
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 2 additions & 8 deletions Examples/FullBufferTest/StartClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,13 @@

$loop = $client->getLoop();

$looping = true;
$loop->addTimer(
5,
function () use (&$looping) {
$looping = false;
function () use (&$loop) {
$loop->stop();
}
);

while ($looping) {
usleep(1000);
$loop->tick();
}

echo "Looping no more...\n";

// run forever
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"symfony/event-dispatcher": "^2.7|^3.0|^4.0",
"voryx/thruway-common": "^1.0.3",
"thruway/client": "^0.5.0",
"react/event-loop": "^0.4.3",
"react/event-loop": "^1.0 || ^0.5 || ^0.4.3",
"react/promise": "^2.3.0",
"thruway/ratchet-transport": "^0.5.0"
},
Expand Down

0 comments on commit ed2e785

Please sign in to comment.