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.
Determine whether the current coroutine was canceled.
Wait for the given coroutines to finish.
Get the coroutine stats.
Check if a coroutine exists or not.
No description
Details
at line 17
__construct(callable $callable)
No description
at line 19
CoroutineInterface
execute(mixed ...$data)
No description
at line 24
int
getId()
Get the coroutine ID.
at line 29
static CoroutineInterface
create(callable $callable, mixed ...$data)
Create and execute a new coroutine.
at line 34
static int
id()
No description
at line 42
static int
pid(int|null $id = null)
Returns the parent coroutine ID.
Returns 0 when running in the top level coroutine.
at line 50
static void
set(array $config)
Set the process-wide coroutine configuration.
The configuration affects every coroutine subsequently created in the worker process.
at line 56
static ArrayObject|null
getContextFor(int|null $id = null)
No description
at line 61
static void
defer(callable $callable)
Execute callback when coroutine destruct.
at line 66
static bool
yield()
Yield the current coroutine.
at line 71
static bool
resumeById(int $id)
Resume the coroutine by coroutine ID.
at line 76
static bool
cancelById(int $id, bool $throwException = false)
Cancel the coroutine by coroutine ID.
at line 84
static bool
isCanceled()
Determine whether the current coroutine was canceled.
This state must be inspected at the cancellation boundary. It returns false outside a coroutine.
at line 94
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 99
static array
stats()
Get the coroutine stats.
at line 104
static bool
exists(int $id)
Check if a coroutine exists or not.
at line 109
static iterable
list()
No description