Skip to content

Commit f4cc094

Browse files
author
Nenad Stojanovikj
committed
Replace $loop->tick() with similar hack
1 parent b0c9ed9 commit f4cc094

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Promise.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,12 @@ public function getState()
175175
*/
176176
public function wait($unwrap = true)
177177
{
178+
$loop = $this->loop;
178179
while (HttpPromise::PENDING === $this->getState()) {
179-
$this->loop->tick();
180+
$loop->futureTick(function () use ($loop) {
181+
$loop->stop();
182+
});
183+
$loop->run();
180184
}
181185

182186
if ($unwrap) {

0 commit comments

Comments
 (0)