Lines Matching refs:promise
48 $promise = new Promise([$queue, 'run']);
49 $queue->add(function () use ($task, $promise) {
51 if (Is::pending($promise)) {
52 $promise->resolve($task());
55 $promise->reject($e);
57 $promise->reject($e);
61 return $promise;
74 * @param PromiseInterface $promise Promise or value.
78 public static function inspect(PromiseInterface $promise) argument
83 'value' => $promise->wait()
109 foreach ($promises as $key => $promise) {
110 $results[$key] = inspect($promise);
133 foreach ($promises as $key => $promise) {
134 $results[$key] = $promise->wait();
156 $promise = Each::of(
170 $promise = $promise->then(function ($results) use ($recursive, &$promises) {
171 foreach ($promises as $promise) {
172 if (Is::pending($promise)) {
180 return $promise;