code: protected function waitForReadyRead($time = 0)
      {
          if (!$this->isConnected() || $this->config["blocking"]) {
              return;
          }
  
          do {
              $read = array($this->stream);
              $null = null;
  
              if ($time) {
                  Signal::getInstance()->emit(
                      strtolower($this->getAdapterType()) . "WaitTimeout",
                      $time,
                      $this->getAdapter()
                  );
              }
  
              $time = $time + $this->config["timeout"];
          } while (@stream_select($read, $null, $null, $this->config["timeout"]) == 0);
      }
docs: Blocks a stream until data is available for reading if the stream is connected
  in non-blocking mode.
  
  @param  integer $time
  @return void