コード例 #1
0
 /**
  * @param AfterAttemptEvent $event
  */
 public function onAfterAttempt(AfterAttemptEvent $event)
 {
     $this->logger->info(sprintf('Completed attempt for "%s" (%s)', $this->name, $this->uniqueId), ['result' => $event->getResult()]);
 }
コード例 #2
0
 /**
  * Check if we have a return we should retry on, and throw an exception if so
  *
  * @param AfterAttemptEvent $event
  */
 public function onAfterAttempt(AfterAttemptEvent $event)
 {
     if (in_array($event->getResult(), $this->returns)) {
         throw new ReturnException('Retrying on return, converting to exception');
     }
 }