Releases: amphp/byte-stream
Releases · amphp/byte-stream
2.0.0 Beta 10
- Reverted
ReadableIterableStream
transforming exceptions from the given iterable intoStreamException
, as this change made the class less flexible for implementing specialized streams throwing domain-specific exceptions.
2.0.0 Beta 9
- Fixed cancelling a read in
ReadableIterableStream
causing all subsequent reads to fail - If the iterable in
ReadableIterableStream
throws an exception that is not an instance ofStreamException
, aStreamException
is thrown with the prior thrown exception set as the previous exception - Renamed the
$options
param ofparseLineDelimitedJson
to$flags
to match thejson_decode
function.
2.0.0 Beta 8
- Removed
Closable
interface since it has been moved toamphp/amp
ReadableStream
andWritableStream
now extendAmp\Closable
2.0.0 Beta 7
2.0.0 Beta 6
- Fixed double close error in
WritableBuffer
- Drop PHP 8.0 support
2.0.0 Beta 5
- Added
StreamChannel
implementing theChannel
interface fromamphp/sync
.
2.0.0 Beta 4
- Compatibility with revolt/event-loop v0.2.x
- Added
BufferedReader
, a helper class for reading fromReadableStream
using fixed lengths or delimiters found within the stream (#94) - Renamed
IterableStream
toReadableIterableStream
- Renamed
EmitterStream
toWritableIterableStream
and removed the constructorEmitter
param. UseWritableIterableStream::getIterator()
to retrieve the iterable for reading - Fixed error handling writing to
AsyncWriter
after the stream has closed (#93)
2.0.0 Beta 3
- Fixed
@throws
annotations inWritableStream
2.0.0 Beta 2
- Removed the optional
$bytes
parameter fromWritableStream::end()
. ReadableResourceStream::read()
now performs a read immediately on the stream to avoid leaving data in PHP's internal stream buffers.- Renamed
$length
param onReadableResourceStream::read()
to$limit
to better reflect its purpose. - Added a
$limit
param toAmp\ByteStream\buffer()
andPayload::buffer()
to set a limit on the maximum bytes that can be buffered.
2.0.0 Beta 1
Initial beta release compatible with amphp v3.
There are a number of renaming and compatibility breaks with v1.x
.
- Added interfaces
ClosableStream
andResourceStream
InputStream
has been renamed toReadableStream
and now extendsClosableStream
. Theread()
method now supports an optionalCancellation
parameter.OutputStream
has been renamed toWritableStream
and now extendsClosableStream
.IteratorStream
has been repalced byIterableStream
, which accepts anyiterable
ofstring
s (particularly useful withGenerator
orPipeline
).ResourceInputStream
has been renamed toReadableResourceStream
. Theread()
method has an additional, optional$length
parameter to specify the maximum number of bytes to read.ResourceOutputStream
has been renamed toWritableResourceStream
.InMemoryStream
has been renamed toReadableBuffer
.OutputBuffer
has been renamed toWritableBuffer
.Payload
now accepts astring
in addition to aReadableStream
.Payload::buffer()
may only be called once.- Added
Pipe
andEmitterStream
classes. - The zlib streams have been moved into the
Compression
sub-namespace and renamed toCompressingWritableStream
andDecompressingReadableStream
. - The base-64 streams have been renamed to reflect the new interface names.
InputStreamChain
has been renamed toReadableStreamChain
.