Sphinx\SphinxClient::setRetries PHP Method

setRetries() public method

Set distributed retries count and delay
public setRetries ( integer $count, integer $delay ) : SphinxClient
$count integer
$delay integer
return SphinxClient
    public function setRetries($count, $delay = 0)
    {
        $count = intval($count);
        $delay = intval($delay);
        if ($count < 0) {
            throw new \InvalidArgumentException('Retry count cannot be negative.');
        }
        if ($delay < 0) {
            throw new \InvalidArgumentException('Retry delay cannot be negative.');
        }
        $this->retrycount = $count;
        $this->retrydelay = $delay;
        return $this;
    }

Usage Example

Example #1
0
 public function testSetRetries()
 {
     $sphinx = new SphinxClient();
     $sphinx->setRetries(3, 10);
     $this->assertSame($sphinx->retrycount, 3);
     $this->assertSame($sphinx->retrydelay, 10);
 }
All Usage Examples Of Sphinx\SphinxClient::setRetries