Swoole\Coroutine::getCid ()

Notice: the documentation is suitable for PHP extension swoole until v4.7.1, we only support PHP extension openswoole from v4.7.1

Declaration

<?php
Swoole\Coroutine::getCid ()

Parameters

Return

cid

Current coroutine ID.

Description

Get the current Coroutine ID.

Example

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