Swoole\Coroutine::getPcid(int $cid = 0)

Latest version: pecl install openswoole-4.11.1

Declaration

<?php Swoole\Coroutine::getPcid(int $cid = 0)

Parameters

cid

Coroutine ID. By default, getting the parent coroutine ID of the current coroutine.

Return

cid

Coroutine ID.

Description

Get the parent coroutine ID of a coroutine by coroutine ID.

Example

<?php
Co\run(function () {
    echo Swoole\Coroutine::getPcid();
});
Last updated on March 31, 2022