Namespaces

Classes

Unbuffered Channels


An unbuffered channel will block on calls to Channel::send() until there is a receiver, and block on calls to Channel::recv() until there is a sender. This means an unbuffered channel is not only a way to share data among tasks but also a simple method of synchronization.

The Event Loop


The Event loop monitors the state of sets of futures and or channels (targets) in order to perform read (Future::value(), Channel::recv()) and write (Channel::send()) operations as the targets become available and the operations may be performed without blocking the event loop.

A Future represents the return value or uncaught exception from a task, and exposes an API for cancellation.

Each runtime represents a single PHP thread, the thread is created (and bootstrapped) upon construction. The thread then waits for tasks to be scheduled: Scheduled tasks will be executed FIFO and then the thread will resume waiting until more tasks are scheduled, or it's closed, killed, or destroyed by the normal scoping rules of PHP objects.

The Sync class provides access to low level synchronization primitives, mutex, condition variables, and allows the implementation of semaphores.

Functions

void
bootstrap(string $file)

Shall use the provided file to bootstrap all runtimes created for automatic scheduling via run().

int
count()

No description

Future|null
run(Closure $task, array $argv = null)

No description