Skip to content

2.0.0

Compare
Choose a tag to compare
@kelunik kelunik released this 07 Jan 16:35
· 11 commits to 2.x since this release
v2.0.0
c102b62

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 (#99)
  • Add DecompressingWritableStream (#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.