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

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