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) |
||
100 | |||
101 | /** |
||
102 | * @param PromiseInterface $promise |
||
103 | * @param int|float $time |
||
104 | * @param LoopInterface $loop |
||
105 | * |
||
106 | * @return \Cubiche\Core\Async\Promise\PromiseInterface |
||
107 | */ |
||
108 | public static function timeout(PromiseInterface $promise, $time, LoopInterface $loop) |
||
131 | |||
132 | /** |
||
133 | * @param PromiseInterface $promise |
||
134 | * @param LoopInterface $loop |
||
135 | * @param int|float $timeout |
||
136 | * |
||
137 | * @throws RejectionException |
||
138 | * |
||
139 | * @return mixed |
||
140 | */ |
||
141 | public static function get(PromiseInterface $promise, LoopInterface $loop, $timeout = null) |
||
172 | |||
173 | /** |
||
174 | * @param ThenableInterface $thenable |
||
175 | * |
||
176 | * @return \Cubiche\Core\Async\Promise\PromisorInterface |
||
177 | */ |
||
178 | public static function promisor(ThenableInterface $thenable) |
||
182 | } |
||
183 |