Swoole\Coroutine::exists

4.x is outdated, please check the latest version 22.x


Latest version: pecl install openswoole-22.1.2

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());
});
Last updated on August 31, 2022