Exemple #1
0
 /**
  * {@inheritdoc}
  */
 protected function onResolve($value = null)
 {
     $value = $this->callResolveCallback($value);
     if ($value instanceof PromiseInterface) {
         $value->done(function ($actual) {
             $this->deferred->resolve($actual);
         }, function ($reason) {
             $this->deferred->reject($reason);
         }, function ($state) {
             $this->deferred->notify($state);
         });
     } else {
         $this->deferred->resolve($value);
     }
 }
Exemple #2
0
 /**
  * @param mixed $state
  */
 protected function notify($state = null)
 {
     $this->deferred->notify($state);
 }