Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Byte Stream Laravel Package

amphp/byte-stream

Event-driven byte stream abstractions for PHP 8.1+ in the AMPHP ecosystem. Provides ReadableStream/WritableStream interfaces plus implementations like Payload, buffers, resource/iterable streams, stream chaining, base64 encode/decode, and decompression for fiber-friendly I/O.

View on GitHub
Deep Wiki
Context7
v2.1.2
  • Fixed the exception type thrown if ReadableIterableStream is closed (Amp\Pipeline\DisposedException was leaked, now an Amp\ByteStream\ClosedException is thrown).

Full Changelog: https://github.com/amphp/byte-stream/compare/v2.1.1...v2.1.2

v1.8.2

What's Changed

New Contributors

Full Changelog: https://github.com/amphp/byte-stream/compare/v1.8.1...v1.8.2

v2.1.1

What's Changed

  • Fixed cancellation not being forwarded to split() in splitLines().

Full Changelog: https://github.com/amphp/byte-stream/compare/v2.1.0...v2.1.1

v2.1.0

What's Changed

New Contributors

Full Changelog: https://github.com/amphp/byte-stream/compare/v2.0.2...v2.1.0

v2.0.2
  • Fixed throwing an Error when invoking getStdin(), getStdout(), and getStderr() if the corresponding STDIO stream had been previously closed. Instead, an already closed stream instance is returned.
v2.0.1
  • Fixed 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.
v2.0.0

Initial stable release compatible with AMPHP v3 and fibers.

There are a number of renaming and compatibility breaks with 1.x versions:

  • Added interface 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 strings (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.
  • Added a $limit param to Amp\ByteStream\buffer() and Payload::buffer() to set a limit on the maximum bytes that can be buffered.
  • Added BufferedReader, a helper class for reading from ReadableStream using fixed lengths or delimiters found within the stream (#94)
  • Added Pipe.
  • Added StreamChannel implementing the Channel interface from amphp/sync.
  • The zlib streams have been moved into the Compression sub-namespace and renamed to CompressingWritableStream and DecompressingReadableStream.
  • Add CompressingReadableStream (https://github.com/amphp/byte-stream/pull/99)
  • Add DecompressingWritableStream (https://github.com/amphp/byte-stream/pull/99)
  • The base64 streams have been renamed to reflect the new interface names.
  • InputStreamChain has been renamed to ReadableStreamChain.
  • Renamed the $options param of parseLineDelimitedJson to $flags to match the json_decode function.
v2.0.0-beta.14
  • Marked Payload as final
  • Fixed compatibility with amphp/pipeline@v1.0 (#101)
v2.0.0-beta.13

Improved performance of continuous reads in ReadableResourceStream

v2.0.0-beta.12
  • Add compatibility with Revolt v1.x
v2.0.0-beta.11
v2.0.0-beta.10
  • Reverted ReadableIterableStream transforming exceptions from the given iterable into StreamException, as this change made the class less flexible for implementing specialized streams throwing domain-specific exceptions.
v2.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 of StreamException, a StreamException is thrown with the prior thrown exception set as the previous exception
  • Renamed the $options param of parseLineDelimitedJson to $flags to match the json_decode function.
v2.0.0-beta.8
  • Removed Closable interface since it has been moved to amphp/amp
  • ReadableStream and WritableStream now extend Amp\Closable
v2.0.0-beta.7
v2.0.0-beta.6
  • Fixed double close error in WritableBuffer
  • Drop PHP 8.0 support
v2.0.0-beta.5
  • Added StreamChannel implementing the Channel interface from amphp/sync.
v2.0.0-beta.4
  • Compatibility with revolt/event-loop v0.2.x
  • Added BufferedReader, a helper class for reading from ReadableStream using fixed lengths or delimiters found within the stream (#94)
  • Renamed IterableStream to ReadableIterableStream
  • Renamed EmitterStream to WritableIterableStream and removed the constructor Emitter param. Use WritableIterableStream::getIterator() to retrieve the iterable for reading
  • Fixed error handling writing to AsyncWriter after the stream has closed (#93)
v2.0.0-beta.3
  • Fixed [@throws](https://github.com/throws) annotations in WritableStream
v2.0.0-beta.2
  • Removed the optional $bytes parameter from WritableStream::end().
  • ReadableResourceStream::read() now performs a read immediately on the stream to avoid leaving data in PHP's internal stream buffers.
  • Renamed $length param on ReadableResourceStream::read() to $limit to better reflect its purpose.
  • Added a $limit param to Amp\ByteStream\buffer() and Payload::buffer() to set a limit on the maximum bytes that can be buffered.
v2.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 and ResourceStream
  • InputStream has been renamed to ReadableStream and now extends ClosableStream. The read() method now supports an optional Cancellation parameter.
  • OutputStream has been renamed to WritableStream and now extends ClosableStream.
  • IteratorStream has been repalced by IterableStream, which accepts any iterable of strings (particularly useful with Generator or Pipeline).
  • ResourceInputStream has been renamed to ReadableResourceStream. The read() method has an additional, optional $length 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. Payload::buffer() may only be called once.
  • Added Pipe and EmitterStream classes.
  • The zlib streams have been moved into the Compression sub-namespace and renamed to CompressingWritableStream and DecompressingReadableStream.
  • The base-64 streams have been renamed to reflect the new interface names.
  • InputStreamChain has been renamed to ReadableStreamChain.
v1.8.1
  • Fixed ResourceInputStream::close() if resource is already closed on PHP 8
  • Fixed ResourceOutputStream::close() if resource is already closed on PHP 8
v1.8.0
  • Added custom delimiter support to LineReader (#77)
  • Added base64 streams (#73)
  • Increased minimum PHP version to PHP 7.1
v1.7.3
  • Add psalm annotations for static analysis
v1.7.2
  • Updated ResourceOutputStream to be compatible with changes made to EAGAIN and EPIPE error handling in PHP 7.4 (#70, #71)
v1.7.1
  • Fixed ResourceInputStream not properly nulling the resource on close (#67, #68)
v1.7.0
  • Added LineReader (#64)
  • Added line delimited JSON parser (#65)
  • Added InputStreamChain (#66)
v1.6.1
  • Fixed ResourceOutputStream::write() or ResourceOutputStream::end() when writing to a peer closed stream throwing from the method call instead of failing the returned promise.
v1.6.0
  • Added setChunkSize() to ResourceInputStream and ResourceOutputStream (#50)
  • Added getInputBufferStream() and getOutputBufferStream() (#61)
  • Fixed closed detection for ResourceOutputStream, allowing usage with systemd (#58)
v1.5.1
  • Fixed broken symlink in release tars.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4