Lines Matching refs:stream
5 * Represents an asynchronous read-only stream that supports a drain event and
6 * pumping data from a source stream.
8 * The AsyncReadStream can be used as a completely asynchronous stream, meaning
9 * the data you can read from the stream will immediately return only
15 * of bytes are available or the remote source stream has errored, closed, or
43 * provided stream must answer to the "hwm" stream metadata variable,
49 * - drain: (callable) Function to invoke when the stream has drained,
52 * The function accepts a single argument, the buffer stream object that
55 * from the source stream. This function will block until all of the data
56 * that was requested has been read, EOF of the source stream, or the
57 * source stream is closed.
101 $this->stream = $buffer;
105 * Factory method used to create new async stream and an underlying buffer
117 * length. When exceeded, the stream will begin dropping data. Set the
184 $this->needsDrain = $this->stream->getSize() >= $this->hwm;
187 $result = $this->stream->read($length);
190 if ($this->needsDrain && $this->stream->getSize() === 0) {
193 $drainFn($this->stream);