\Psc\Library\CoroutineCoroutine

兼容性:Process模块 2024-07-13

Summary

Methods
Properties
Constants
getInstance()
await()
async()
__construct()
sleep()
isCoroutine()
getCoroutine()
handleEscapeException()
No public properties found
No constants found
No protected methods found
$instance
N/A
registerOnFork()
$fiber2callback
N/A

Properties

$fiber2callback

$fiber2callback : array

Type

array

Methods

getInstance()

getInstance() : static

Returns

static —

await()

await(\Psc\Core\Coroutine\Promise  $promise) : mixed

Parameters

\Psc\Core\Coroutine\Promise $promise

Throws

\Throwable

Returns

mixed —

async()

async(\Closure  $closure) : \Psc\Core\Coroutine\Promise

Parameters

\Closure $closure

Returns

\Psc\Core\Coroutine\Promise —

__construct()

__construct() : mixed

Returns

mixed —

sleep()

sleep(float|int  $second) : void

Parameters

float|int $second

Throws

\Throwable

isCoroutine()

isCoroutine() : bool

Returns

bool —

getCoroutine()

getCoroutine() : array|null

Returns

array|null —

handleEscapeException()

handleEscapeException(\Psc\Library\Coroutine\EscapeException  $exception) : void

Parameters

\Psc\Library\Coroutine\EscapeException $exception

Throws

\Psc\Library\Coroutine\EscapeException
\Throwable

registerOnFork()

registerOnFork() : void