A non-blocking stream abstraction for PHP based on Amp.
Full Changelog: https://github.com/amphp/byte-stream/compare/v1.8.1...v1.8.2
split()
in splitLines()
.Full Changelog: https://github.com/amphp/byte-stream/compare/v2.1.0...v2.1.1
Payload
now implements Stringable
split
by @xtrime-ru in https://github.com/amphp/byte-stream/pull/108
Full Changelog: https://github.com/amphp/byte-stream/compare/v2.0.2...v2.1.0
Error
when invoking getStdin()
, getStdout()
, and getStderr()
if the corresponding STDIO stream had been previously closed. Instead, an already closed stream instance is returned.ReadableResourceStream
calling Suspension::resume()
when destroyed, which could throw an exception when suspending from {main}
and an uncaught exception was thrown from the event loop.Initial stable release compatible with AMPHP v3 and fibers.
There are a number of renaming and compatibility breaks with 1.x
versions:
ResourceStream
InputStream
has been renamed to ReadableStream
and now extends Amp\Closable
. The read()
method now supports an optional Cancellation
parameter.OutputStream
has been renamed to WritableStream
and now extends Amp\Closable
. WritableStream::end()
no longer accepts an optional data chunk as parameter.IteratorStream
has been repalced by ReadableIterableStream
, which accepts any iterable
of string
s (particularly useful with Generator
or Pipeline
).ResourceInputStream
has been renamed to ReadableResourceStream
. The read()
method has an additional, optional $limit
parameter to specify the maximum number of bytes to read.ResourceOutputStream
has been renamed to WritableResourceStream
.InMemoryStream
has been renamed to ReadableBuffer
.OutputBuffer
has been renamed to WritableBuffer
.Payload
now accepts a string
in addition to a ReadableStream
and is final
now. Payload::buffer()
may only be called once.$limit
param to Amp\ByteStream\buffer()
and Payload::buffer()
to set a limit on the maximum bytes that can be buffered.BufferedReader
, a helper class for reading from ReadableStream
using fixed lengths or delimiters found within the stream (#94)Pipe
.StreamChannel
implementing the Channel
interface from amphp/sync
.Compression
sub-namespace and renamed to CompressingWritableStream
and DecompressingReadableStream
.CompressingReadableStream
(https://github.com/amphp/byte-stream/pull/99)DecompressingWritableStream
(https://github.com/amphp/byte-stream/pull/99)InputStreamChain
has been renamed to ReadableStreamChain
.$options
param of parseLineDelimitedJson
to $flags
to match the json_decode
function.Payload
as finalamphp/[email protected]
(#101)Improved performance of continuous reads in ReadableResourceStream
CompressingReadableStream
(https://github.com/amphp/byte-stream/pull/99)DecompressingWritableStream
(https://github.com/amphp/byte-stream/pull/99)StreamChannel
implementation to properly support backpressure, cancellation and avoid keeping the read watcher alive (https://github.com/amphp/byte-stream/pull/100)