Example #1
0
 /**
  * Retry connecting to the transport
  */
 public function retryConnection()
 {
     $options = $this->reconnectOptions;
     if ($this->attemptRetry === false) {
         return;
     }
     if ($options['max_retries'] <= $this->retryAttempts) {
         return;
     }
     $this->retryAttempts++;
     if ($this->retryTimer >= $options['max_retry_delay']) {
         $this->retryTimer = $options['max_retry_delay'];
     } elseif ($this->retryTimer == 0) {
         $this->retryTimer = $options['initial_retry_delay'];
     } else {
         $this->retryTimer = $this->retryTimer * $options['retry_delay_growth'];
     }
     $this->loop->addTimer($this->retryTimer, function () {
         $this->transportProvider->startTransportProvider($this, $this->loop);
     });
 }