8000 Fixed and added test-case for next-tick events added by timers. · reactphp/event-loop@0c42fea · GitHub
[go: up one dir, main page]

Skip to content

Commit 0c42fea

Browse files
committed
Fixed and added test-case for next-tick events added by timers.
1 parent 2cbc5fe commit 0c42fea

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

StreamSelectLoop.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,12 @@ public function run()
199199

200200
$this->timers->tick();
201201

202+
// Timers have placed more items on the next-tick queue ...
203+
if (!$this->nextTickQueue->isEmpty()) {
204+
$timeout = 0;
205+
202206
// There is a pending timer, only block until it is due ...
203-
if ($scheduledAt = $this->timers->getFirst()) {
207+
} elseif ($scheduledAt = $this->timers->getFirst()) {
204208

205209
if (0 > $timeout = $scheduledAt - $this->timers->getTime()) {
206210
$timeout = 0;

0 commit comments

Comments
 (0)
0