Skip to content

Commit 49504ea

Browse files
committed
Use EventLoop->tick instead of EventLoop->run
With `run` the whole loop is run even if there are others things inside. By relying on the `tick` function we run the loop only until the request is done.
1 parent ad8f049 commit 49504ea

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/ReactPromiseAdapter.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ public function wait()
126126
if( null === $this->loop ) {
127127
throw new \LogicException("You must set the loop before wait!");
128128
}
129-
$this->loop->run();
129+
while( Promise::PENDING === $this->getState() ) {
130+
$this->loop->tick();
131+
}
130132
}
131133
}

0 commit comments

Comments
 (0)