Skip to content

Commit bd7bf23

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 f63054e commit bd7bf23

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/React/EventLoop/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)