Skip to content

Commit

Permalink
Use Coroutine::list instead of Coroutine::listCoroutines (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasbeaujean authored Sep 17, 2024
1 parent e5a13ce commit c549d0f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Context/Swoole/src/SwooleContextHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function switchToActiveCoroutine(): void
public function splitOffChildCoroutines(): void
{
$pcid = Coroutine::getCid();
foreach (Coroutine::listCoroutines() as $cid) {
foreach (method_exists(Coroutine::class, 'list') ? Coroutine::list() : Coroutine::listCoroutines() as $cid) {
if ($pcid === Coroutine::getPcid($cid) && !$this->isForked($cid)) {
$this->forkCoroutine($cid);
}
Expand Down

0 comments on commit c549d0f

Please sign in to comment.