Swoole\Coroutine::exists

Notice: ext-swoole is supported until v4.7.1, use ext-openswoole >= v4.7.1. Latest version: pecl install openswoole-4.9.1

Declaration

<?php
Swoole\Coroutine::exists(int $cid): bool

Parameters

cid

coroutine ID.

Return

exists

if success, it returns TRUE, otherwise it returns FALSE.

Description

Check if a coroutine is exists by coroutine ID.

Example

<?php
Co\run(function () {
  echo Swoole\Coroutine::exists(Swoole\Coroutine::getCid());
});