@param Call $call
@param array $options
@param string $status

@return PromiseInterface
@throws ApiException
427509
private function retry(Call $call, array $options, $status)
    {
        $delayMult = $this->retrySettings->getRetryDelayMultiplier();
        $maxDelayMs = $this->retrySettings->getMaxRetryDelayMillis();
        $timeoutMult = $this->retrySettings->getRpcTimeoutMultiplier();
        $maxTimeoutMs = $this->retrySettings->getMaxRpcTimeoutMillis();
        $totalTimeoutMs = $this->retrySettings->getTotalTimeoutMillis();

        $delayMs = $this->retrySettings->getInitialRetryDelayMillis();
        $timeoutMs = $options['timeoutMillis'];
        $currentTimeMs = $this->getCurrentTimeMs();
        $deadlineMs = $this->deadlineMs ?: $currentTimeMs + $totalTimeoutMs;

        if ($currentTimeMs >= $deadlineMs) {
            throw new ApiException(
                'Retry total timeout exceeded.',
                \Google\Rpc\Code::DEADLINE_EXCEEDED,
                ApiStatus::DEADLINE_EXCEEDED
            );
        }

        // Don't sleep if the failure was a timeout
        if ($status != ApiStatus::DEADLINE_EXCEEDED) {
            usleep($delayMs * 1000);
        }
        $delayMs = min($delayMs * $delayMult, $maxDelayMs);
        $timeoutMs = min(
            $timeoutMs * $timeoutMult,
            $maxTimeoutMs,
            $deadlineMs - $this->getCurrentTimeMs()
        );

        $nextHandler = new RetryMiddleware(
            $this->nextHandler,
            $this->retrySettings->with([
                'initialRetryDelayMillis' => $delayMs,
            ]),
            $deadlineMs
        );

        // Set the timeout for the call
        $options['timeoutMillis'] = $timeoutMs;

        return $nextHandler(
            $call,
            $options
        );
    }
1374290
@Override
	public Promise call(String name, Tree params, Options opts, PacketStream stream, Context parent) {
		String targetID;
		int remaining;
		if (opts == null) {
			targetID = null;
			remaining = 0;
		} else {
			targetID = opts.nodeID;
			remaining = opts.retryCount;
		}
		return call(name, params, opts, stream, parent, targetID, remaining);
	}
668506
function loadWithPromise (options) {
  return new Promise((resolve, reject) => {
    loadWithCallback(options, (error, config) => {
      if (error) {
        reject(error)
      } else {
        resolve(config)
      }
    })
  })
}
615443
public function jsonResponseSuccess(array $data = [], $status = 200, $code = 'success', array $headers = [], $options = 0)
    {
        return $this->jsonResponse()->success($data, $status, $code, $headers, $options);
    }
485236
public function post($url, $params = '', $options = array()) {
        return parent::post($url, format_postdata_for_curlcall($params), $options);
    }
717564
public function on($key,$func,$priority=10,$options=array()) {
		$call = $options ? array($func,$options) : $func;
		if ($e = &$this->f3->ref($this->ekey.$key))
			$e[$priority][] = $call;
		else
			$e = array($priority=>array($call));
		krsort($e);
	}
994406
public function execute(array $args, array $options = array())
    {
        if (!count($args)) {
            throw new ConsoleException("Missing subcommand name");
        }
        
        $command = ucfirst(Utils::camelize(array_shift($args)));
        $methodName = "execute$command";
        if (!method_exists($this, $methodName)) {
            throw new ConsoleException("Command '$command' does not exist");
        }

        $method = new ReflectionMethod($this, $methodName);
        $params = Utils::computeFuncParams($method, $args, $options);
        return $method->invokeArgs($this, $params);
    }
1058371
public static <ReqT, RespT> ListenableFuture<RespT> futureUnaryCall(
      ClientCall<ReqT, RespT> call, ReqT req) {
    GrpcFuture<RespT> responseFuture = new GrpcFuture<>(call);
    asyncUnaryRequestCall(call, req, new UnaryStreamToFuture<>(responseFuture), false);
    return responseFuture;
  }
478307
private function onRejected(RequestInterface $request, array $options)
    {
        return function ($reason) use ($request, $options) {
            if (!$reason instanceof ClientException) {
                return new RejectedPromise($reason);
            }

            $response = $reason->getResponse();

            if ($next = $this->handleUnauthenticatedResponse($request, $response, $options)) {
                return $next;
            }

            return new RejectedPromise($reason);
        };
    }
761350
public function post($url, $params, $options = [], $headers = []) {
        return $this->makeCall('post', $url, $params, $options, $headers);
    }
607886
private function preUse(Middleware $call)
    {
        $class = get_class($call);
        if (in_array($class, $this->preMiddlewareArr)) {
            throw new Exception($class . ' Pre-Middleware has loaded');
        }
        $this->preMiddlewareArr[] = $class;
        if ($this->preMiddleware) {
            $call->nextMiddleware($this->preMiddleware);
        }
        $call->setVitex($this);
        $this->preMiddleware = $call;
        return $this;
    }
132425
public function request($method, $uri, array $parameters = [], array $options = [])
    {
        $parameters['key'] = $this->apiKey;
        $options['query'] = $parameters;

        $uri = $this->apiUrl.$uri.'/json';

        $this->log($method, $uri, $options);
        $response = $this->httpClient->request($method, $uri, $options);

        $result = $this->decoder->decode($response);

        if (!isset($result['status'])) {
            throw new ClientErrorException('Missing return status');
        }

        if (!in_array($result['status'], [
                'OK',
                'ZERO_RESULTS',
            ], true)) {
            throw new ClientErrorException(sprintf('Invalid return status "%s"', $result['status']));
        }

        return $result;
    }
576203
public function addCall($method, $params = array())
	{
		$call = array('name' => $method, 'params' => $params);

		$calls = $this->listCalls();
		$calls[] = $call;
		$this->setOption('calls', $calls);

		return $call;
	}
240304
public function json($data = [], $status = 200, array $headers = [], $options = 0)
    {
        return new JsonResponse($data, $status, $headers, $options);
    }
720754
protected static function _staticRequest($method, $url, $params, $options)
    {
        $opts = \Stripe\Util\RequestOptions::parse($options);
        $baseUrl = isset($opts->apiBase) ? $opts->apiBase : static::baseUrl();
        $requestor = new \Stripe\ApiRequestor($opts->apiKey, $baseUrl);
        list($response, $opts->apiKey) = $requestor->request($method, $url, $params, $opts->headers);
        $opts->discardNonPersistentHeaders();
        return [$response, $opts];
    }
159773
protected function respond($response, $request, $options, $statusCode)
    {
        if (array_key_exists('webhooks', $response)) {
            $results = [];
            foreach ($response['webhooks'] as $result) {
                $results[] = $this->mapResponse($result, $statusCode);
            }

            return $results;
        }

        // IPN response
        if (in_array(Arr::get($response, 'body'), ['VERIFIED', 'INVALID'])) {
            $response = array_merge($request, $response);
        }
        // charge request
        elseif (array_key_exists('continue_url', $options)) {
            $response['continue_url'] = $options['continue_url'];
            $response['is_redirect'] = true;
        }

        return $this->mapResponse($response, $statusCode);
    }
997770
private function repackageCallIfNewArguments(Call $call, array $arguments)
    {
        if ($arguments === $call->getArguments()) {
            return $call;
        }

        return $this->repackageCallWithNewArguments($call, $arguments);
    }