| Conditions | 4 |
| Paths | 4 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 2 |
| 1 | <?php |
||
| 38 | public function handleTimeout() |
||
| 39 | { |
||
| 40 | $delay = $this->expMinDelayMicroSeconds; |
||
| 41 | |||
| 42 | while (true) { |
||
| 43 | $this->manager->executeRequest(); |
||
| 44 | if ($this->manager->isProcessFinished()) { |
||
| 45 | break; |
||
| 46 | } |
||
| 47 | |||
| 48 | usleep((int)$delay); |
||
| 49 | $delay = $delay * $this->expFactor; |
||
| 50 | if ((int)$delay > $this->expMaxDelayMicroSeconds) { |
||
| 51 | throw new Exception('Timeout on server side expired'); |
||
| 52 | } |
||
| 53 | $delay += cumnormdist($delay * $this->expJitter); |
||
| 54 | } |
||
| 57 |