1 | <?php |
||
21 | class Promises |
||
22 | { |
||
23 | /** |
||
24 | * @return \Cubiche\Core\Async\Promise\DeferredInterface |
||
25 | */ |
||
26 | public static function defer() |
||
30 | |||
31 | /** |
||
32 | * @param mixed $value |
||
33 | * |
||
34 | * @return \Cubiche\Core\Async\Promise\PromiseInterface |
||
35 | */ |
||
36 | public static function fulfilled($value = null) |
||
40 | |||
41 | /** |
||
42 | * @param mixed $reason |
||
43 | * |
||
44 | * @return \Cubiche\Core\Async\Promise\PromiseInterface |
||
45 | */ |
||
46 | public static function rejected($reason = null) |
||
50 | |||
51 | /** |
||
52 | * @param PromiseInterface[] $promises |
||
53 | * |
||
54 | * @return \Cubiche\Core\Async\Promise\PromiseInterface |
||
55 | */ |
||
56 | public static function all($promises) |
||
60 | |||
61 | /** |
||
62 | * @param PromiseInterface[] $promises |
||
63 | * @param callable $map |
||
64 | * |
||
65 | * @return \Cubiche\Core\Async\Promise\PromiseInterface |
||
66 | */ |
||
67 | public static function map($promises, callable $map = null) |
||
98 | |||
99 | /** |
||
100 | * @param PromiseInterface $promise |
||
101 | * @param int|float $time |
||
102 | * @param LoopInterface $loop |
||
103 | * |
||
104 | * @return \Cubiche\Core\Async\Promise\PromiseInterface |
||
105 | */ |
||
106 | public static function timeout(PromiseInterface $promise, $time, LoopInterface $loop) |
||
123 | |||
124 | /** |
||
125 | * @param PromiseInterface $promise |
||
126 | * @param LoopInterface $loop |
||
127 | * @param int|float $timeout |
||
128 | * |
||
129 | * @throws RejectionException |
||
130 | * |
||
131 | * @return mixed |
||
132 | */ |
||
133 | public static function get(PromiseInterface $promise, LoopInterface $loop, $timeout = null) |
||
159 | } |
||
160 |