8000 StreamSelectLoop was treating seconds as microseconds, outward behavi… · reactphp/event-loop@3d4b90f · GitHub
[go: up one dir, main page]

Skip to content

Commit 3d4b90f

Browse files
committed
StreamSelectLoop was treating seconds as microseconds, outward behavior was correct but internally many short sleeps/select calls were being made.
1 parent 1d71bf0 commit 3d4b90f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

StreamSelectLoop.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
*/
1414
class StreamSelectLoop implements LoopInterface
1515
{
16+
const MICROSECONDS_PER_SECOND = 1000000;
17+
1618
private $nextTickQueue;
1719
private $futureTickQueue;
1820
private $timers;
@@ -193,7 +195,7 @@ public function run()
193195
break;
194196
}
195197

196-
$this->waitForStreamActivity($timeout);
198+
$this->waitForStreamActivity($timeout * self::MICROSECONDS_PER_SECOND);
197199
}
198200
}
199201

0 commit comments

Comments
 (0)
0