CoroutineInterface
interface CoroutineInterface
Methods
No description
No description
Get the coroutine ID.
Create and execute a new coroutine.
No description
Returns the parent coroutine ID.
Set the process-wide coroutine configuration.
No description
Execute callback when coroutine destruct.
Yield the current coroutine.
Resume the coroutine by coroutine ID.
Cancel the coroutine by coroutine ID.
Wait for the given coroutines to finish.
Get the coroutine stats.
Check if a coroutine exists or not.
No description
Details
at line 16
__construct(callable $callable)
No description
at line 18
CoroutineInterface
execute(mixed ...$data)
No description
at line 23
int
getId()
Get the coroutine ID.
at line 28
static CoroutineInterface
create(callable $callable, mixed ...$data)
Create and execute a new coroutine.
at line 33
static int
id()
No description
at line 41
static int
pid(int|null $id = null)
Returns the parent coroutine ID.
Returns 0 when running in the top level coroutine.
at line 49
static void
set(array $config)
Set the process-wide coroutine configuration.
Boot-only. The configuration affects every coroutine subsequently created in the worker process.
at line 54
static ArrayObject|null
getContextFor(int|null $id = null)
No description
at line 59
static void
defer(callable $callable)
Execute callback when coroutine destruct.
at line 64
static bool
yield()
Yield the current coroutine.
at line 69
static bool
resumeById(int $id)
Resume the coroutine by coroutine ID.
at line 74
static bool
cancelById(int $id, bool $throwException = false)
Cancel the coroutine by coroutine ID.
at line 84
static bool
join(array $coroutineIds, float $timeout = -1)
Wait for the given coroutines to finish.
A false return may mean that no supplied coroutine remained active or that the timeout elapsed. It is not a general failure signal.
at line 89
static array
stats()
Get the coroutine stats.
at line 94
static bool
exists(int $id)
Check if a coroutine exists or not.
at line 99
static iterable
list()
No description