public function send(callable $request, array $args, array $options = [])
{
$retries = isset($options['retries']) ? $options['retries'] : $this->retries;
$grpcOptions = isset($options['grpcOptions']) ? $options['grpcOptions'] : $this->grpcOptions;
$backoff = new ExponentialBackoff($retries, function (\Exception $ex) {
$statusCode = $ex->getCode();
if (in_array($statusCode, $this->grpcRetryCodes)) {
return true;
}
return false;
});
if (!isset($grpcOptions['retrySettings'])) {
$grpcOptions['retrySettings'] = new RetrySettings(null, null);
}
$optionalArgs =& $args[count($args) - 1];
$optionalArgs += $grpcOptions;
try {
return $this->handleResponse($backoff->execute($request, $args));
} catch (\Exception $ex) {
throw $this->convertToGoogleException($ex);
}
}