CoroutineTaskQueue
class CoroutineTaskQueue implements ScopedTaskQueueInterface
Drain each coroutine's callbacks independently and cancel unfinished work at exit, preserving the original queue outside coroutines.
Methods
Retain the existing non-coroutine queue and its shutdown behavior.
Install the routing queue once without replacing an existing installation.
Determine whether the current coroutine has pending tasks.
Add a task to the current coroutine's queue.
Run the current coroutine's pending tasks.
Retain pending transport work until its completion callbacks run.
Discard outside-coroutine test tasks without retaining a shutdown callback.
Resolve the queue owned by the current native coroutine.
Details
at line 25
__construct(TaskQueueInterface $outside)
Retain the existing non-coroutine queue and its shutdown behavior.
at line 34
static void
install()
Install the routing queue once without replacing an existing installation.
Guzzle's queue is process-global; install before scheduling work.
at line 47
bool
isEmpty()
Determine whether the current coroutine has pending tasks.
at line 55
void
add(callable $task)
Add a task to the current coroutine's queue.
at line 63
void
run()
Run the current coroutine's pending tasks.
at line 71
void
track(PromiseInterface $promise)
Retain pending transport work until its completion callbacks run.
at line 81
void
resetOutside()
Discard outside-coroutine test tasks without retaining a shutdown callback.
The PHPUnit extension seeds a shutdown-disabled delegate before installation.
at line 90
protected TaskQueueInterface
current()
Resolve the queue owned by the current native coroutine.