We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b70c282 commit 795a061Copy full SHA for 795a061
1 file changed
src/Loop.php
@@ -84,6 +84,10 @@ public function removeDeferredFromTimer(
84
if($activeDeferredIndex !== false) {
85
unset($this->activeDeferred[$activeDeferredIndex]);
86
}
87
+ if($this->haltWhenAllDeferredComplete
88
+ && empty($this->activeDeferred)) {
89
+ $this->halt();
90
+ }
91
92
93
public function setSleepFunction(callable $sleepFunction):void {
@@ -100,11 +104,6 @@ public function run(bool $forever = true):void {
100
104
do {
101
105
$numTriggered = $this->triggerNextTimers();
102
106
$this->triggerCount += $numTriggered;
103
-
- if($this->haltWhenAllDeferredComplete
- && empty($this->activeDeferred)) {
- $this->halt();
107
- }
108
109
while($numTriggered > 0 && $this->forever);
110
0 commit comments