Skip to content

Commit

Permalink
Merge pull request #294 from WyriHaximus-labs/react-eventloop-1.0-0.5…
Browse files Browse the repository at this point in the history
…-0.4

Forward compatibility with react/event-loop 1.0 and 0.5 while still supporting 0.4
  • Loading branch information
mbonneau committed Apr 9, 2018
2 parents f423c2a + ed2e785 commit 7039e87
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 7039e87

Please sign in to comment.