setDelayFunction() public méthode

public setDelayFunction ( callable $delayFunction ) : void
$delayFunction callable
Résultat void
 public function testSuccessWithNoRetries()
 {
     $actualAttempts = 0;
     $backoff = new ExponentialBackoff();
     $backoff->setDelayFunction($this->delayFunction);
     $backoff->execute(function () use(&$actualAttempts) {
         $actualAttempts++;
         return;
     });
     $this->assertEquals(1, $actualAttempts);
 }