8 require __DIR__ .
'/../vendor/autoload.php';
30 ->then(
function($value) {
34 return $value .
" world";
37 ->then(
function($value) {
46 $promise->fulfill($value .
", how are ya?");
52 ->then(
function($value) {
56 return $value .
" you rock!";
87 $promise->fulfill($value .
", how are ya?");
96 yield $value .
" you rock!";
An implementation of the Promise pattern.
$promise
This example shows demonstrates the Promise api.
setTimeout(callable $cb, $timeout)
Executes a function after x seconds.
coroutine(callable $gen)
Turn asynchronous promise-based code into something that looks synchronous again, through the use of ...