src/Pipe/ReadablePipe.php
public function unshift(string $data)
    {
        $data = (string) $data;

        if (!strlen($data)) {
            return;
        }

        $this->buffer = $data . $this->buffer;

        if (!$this->queue->isEmpty()) {
            /** @var \Icicle\Awaitable\Delayed $delayed */
            $delayed = $this->queue->shift();
            $delayed->resolve();
            $this->poll->cancel();
        }
    }
public function unshift(string $data)
    {
        $data = (string) $data;

        if (!strlen($data)) {
            return;
        }

        $this->buffer = $data . $this->buffer;

        if (!$this->queue->isEmpty()) {
            /** @var \Icicle\Awaitable\Delayed $delayed */
            $delayed = $this->queue->shift();
            $delayed->resolve();
            $this->poll->cancel();
        }
    }
Shifts the given data back to the front of the stream and will be the first bytes returned from any pending or
subsequent read.

@param string $data