/**
  * Executes a waiter.
  *
  * @param Waiter $waiter Waiter to execute.
  *
  * @return AwsS3Response
  */
 protected function executeWaiter(Waiter $waiter)
 {
     try {
         $waiter->promise()->wait(false);
     } catch (AwsException $e) {
         /* Return an error response. */
         return new AwsS3Response(null, $e);
     }
     /* Empty result as waiters return nothing helpful. */
     return new AwsS3Response(null, null);
 }
示例#2
0
 public function waitUntil($name, array $args = [], array $config = [])
 {
     // Create the waiter. If async, then waiting begins immediately.
     $config += $this->api->getWaiterConfig($name);
     $waiter = new Waiter($this, $name, $args, $config);
     // If async, return the future, for access to then()/wait()/cancel().
     if (!empty($args['@future'])) {
         return $waiter;
     }
     // For synchronous waiting, call wait() and don't return anything.
     $waiter->wait();
 }
 /**
  * Executes a waiter.
  *
  * @param Waiter $waiter Waiter to execute.
  *
  * @return AwsDynamoDbResponse
  */
 protected function executeWaiter(Waiter $waiter)
 {
     try {
         $waiter->promise()->wait(false);
     } catch (AwsException $e) {
         /* Return an error response. */
         return new AwsDynamoDbResponse(null, $e);
     }
     /* Waiter responses are not useful, so just set null. */
     return new AwsDynamoDbResponse(null, null);
 }