Skip to content

Commit 2aa13a9

Browse files
committed
Use libev->breakLoop() instead of suspend/resume
Suspend does not break the loop, so the run call would still block. BreakLoop however breaks out, and a future run() will continue the loop.
1 parent d8ad5fd commit 2aa13a9

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

LibEvLoop.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ class LibEvLoop implements LoopInterface
1212
private $readEvents = array();
1313
private $writeEvents = array();
1414
private $timers = array();
15-
private $suspended = false;
1615

1716
public function __construct()
1817
{
@@ -138,17 +137,11 @@ public function tick()
138137

139138
public function run()
140139
{
141-
if ($this->suspended) {
142-
$this->suspended = false;
143-
$this->loop->resume();
144-
} else {
145-
$this->loop->run();
146-
}
140+
$this->loop->run();
147141
}
148142

149143
public function stop()
150144
{
151-
$this->loop->suspend();
152-
$this->suspended = true;
145+
$this->loop->breakLoop();
153146
}
154147
}

0 commit comments

Comments
 (0)