Download the PHP package krakjoe/promises without Composer
On this page you can find all versions of the php package krakjoe/promises. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download krakjoe/promises
More information about krakjoe/promises
Files in krakjoe/promises
Package promises
Short Description Promises in PHP using pthreads v1.0.0+
License PHP
Homepage http://pthreads.org/
Informations about the package promises
promises
Promises in PHP using pthreads v1.0.0+
Promise Manager
The Promise Manager represents a pool of threads used to fulfill promises in parallel.
The only public API for the is the constructor:
public PromiseManager::__construct($size = 4, $worker = \Worker::class, $ctor = [])
See in the PHP manual.
Promise
A represents a promise to execute the public interface of a at some time in the future:
public Promise::__construct(PromiseManager $manager, Promisable $promisable)
A provides the ability to schedule the subsequent execution of the public interface of a .
public Promise Promise::then(Thenable $then)
Interfaces
IPromisable
public void IPromisable::onFulfill();
IThenable
public void IThenable::onFulfilled(Promisable $promised);
public void IThenable::onError(Promisable $promised);
Notes
Exceptions thrown by , or objects will be caught and bubble up to invoke subsequent .
This is a work in progress
Note that, this is a work in progress, that does not aim for maximum compatibility with any established standard but rather an easy to use implementation, that is compatible with and takes full advantage of pthreads.
While reading the API, remember everything you read other than is a pthreads object