Swoole\Coroutine::exists (int $cid)

Declaration

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

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());
});