Changeset View
Changeset View
Standalone View
Standalone View
src/future/Future.php
| Show All 35 Lines | public function resolve() { | ||||
| if (count($args)) { | if (count($args)) { | ||||
| throw new Exception( | throw new Exception( | ||||
| pht( | pht( | ||||
| 'Parameter "timeout" to "Future->resolve()" is no longer '. | 'Parameter "timeout" to "Future->resolve()" is no longer '. | ||||
| 'supported. Update the caller so it no longer passes a '. | 'supported. Update the caller so it no longer passes a '. | ||||
| 'timeout.')); | 'timeout.')); | ||||
| } | } | ||||
| if ($this->hasException()) { | if (!$this->hasResult() && !$this->hasException()) { | ||||
| throw $this->getException(); | |||||
| } | |||||
| if (!$this->hasResult()) { | |||||
| $graph = new FutureIterator(array($this)); | $graph = new FutureIterator(array($this)); | ||||
| $graph->resolveAll(); | $graph->resolveAll(); | ||||
| } | } | ||||
| if ($this->hasException()) { | |||||
| throw $this->getException(); | |||||
| } | |||||
| return $this->getResult(); | return $this->getResult(); | ||||
| } | } | ||||
| final public function startFuture() { | final public function startFuture() { | ||||
| if ($this->hasStarted) { | if ($this->hasStarted) { | ||||
| throw new Exception( | throw new Exception( | ||||
| pht( | pht( | ||||
| 'Future has already started; futures can not start more '. | 'Future has already started; futures can not start more '. | ||||
| ▲ Show 20 Lines • Show All 193 Lines • Show Last 20 Lines | |||||