Skip to content

Commit

Permalink
🚧 integrate EventLoop->idle
Browse files Browse the repository at this point in the history
  • Loading branch information
matyo91 committed Apr 21, 2021
1 parent 4de1766 commit 3092714
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Adapter/Swoole/EventLoop.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,10 @@ public function promiseRejected(\Throwable $throwable): Promise
public function idle(): Promise
{
$promise = new YieldPromise();
Coroutine::create(function() use($promise) {
$promise->resolve(null);
Coroutine::create(function() use ($promise) {
Coroutine::defer(function () use ($promise) {
$promise->resolve(null);
});
});

return $promise;
Expand Down

0 comments on commit 3092714

Please sign in to comment.