/** * {@inheritdoc} * * @param float|int $timeout Timeout for poll if a read was pending. */ public function rebind(float $timeout = 0) { $pending = $this->poll->isPending(); $this->poll->free(); $this->poll = $this->createPoll($this->getResource(), $this->queue); if ($pending) { $this->poll->listen($timeout); } }
/** * {@inheritdoc} * * @param float|int $timeout Timeout for await if a write was pending. */ public function rebind(float $timeout = 0) { if (null !== $this->await) { $pending = $this->await->isPending(); $this->await->free(); $this->await = $this->createAwait($this->getResource(), $this->writeQueue); if ($pending) { $this->await->listen($timeout); } } }