Hprose\Client::retry PHP Method

retry() public method

*private
public retry ( $request, stdClass $context )
$context stdClass
    function retry($request, stdClass $context)
    {
        if ($context->failswitch) {
            $this->failswitch();
        }
        if ($context->idempotent && $context->retried < $context->retry) {
            $interval = ++$context->retried * 0.5;
            if ($context->failswitch) {
                $interval -= (count($this->uriList) - 1) * 0.5;
            }
            if ($interval > 5) {
                $interval = 5;
            }
            $self = $this;
            if ($interval > 0) {
                return $this->wait($interval, function () use($self, $request, $context) {
                    return $self->afterFilterHandler($request, $context);
                });
            } else {
                return $this->afterFilterHandler($request, $context);
            }
        }
        return null;
    }