src/Pipe/ReadablePipe.php
private function createPoll($resource, \SplQueue $queue): Io
    {
        return Loop\poll($resource, static function ($resource, bool $expired) use ($queue) {
            /** @var \Icicle\Awaitable\Delayed $delayed */
            $delayed = $queue->shift();

            if ($expired) {
                $delayed->reject(new TimeoutException('The connection timed out.'));
                return;
            }

            $delayed->resolve();
        });
    }
private function createPoll($resource, \SplQueue $queue): Io
    {
        return Loop\poll($resource, static function ($resource, bool $expired) use ($queue) {
            /** @var \Icicle\Awaitable\Delayed $delayed */
            $delayed = $queue->shift();

            if ($expired) {
                $delayed->reject(new TimeoutException('The connection timed out.'));
                return;
            }

            $delayed->resolve();
        });
    }
@param resource $resource
@param \SplQueue $queue

@return \Icicle\Loop\Watcher\Io