src/Google/Task/Runner.php
public function run()
  {
    while ($this->attempt()) {
      try {
        return call_user_func_array($this->action, $this->arguments);
      } catch (Google_Service_Exception $exception) {
        $allowedRetries = $this->allowedRetries(
            $exception->getCode(),
            $exception->getErrors()
        );

        if (!$this->canAttempt() || !$allowedRetries) {
          throw $exception;
        }

        if ($allowedRetries > 0) {
          $this->maxAttempts = min(
              $this->maxAttempts,
              $this->attempts + $allowedRetries
          );
        }
      }
    }
  }
public function run()
  {
    while ($this->attempt()) {
      try {
        return call_user_func_array($this->action, $this->arguments);
      } catch (Google_Service_Exception $exception) {
        $allowedRetries = $this->allowedRetries(
            $exception->getCode(),
            $exception->getErrors()
        );

        if (!$this->canAttempt() || !$allowedRetries) {
          throw $exception;
        }

        if ($allowedRetries > 0) {
          $this->maxAttempts = min(
              $this->maxAttempts,
              $this->attempts + $allowedRetries
          );
        }
      }
    }
  }
Runs the task and (if applicable) automatically retries when errors occur.

@return mixed
@throws Google_Task_Retryable on failure when no retries are available.