Skip to content

Releases: icicleio/stream

v0.5.5

21 Feb 19:33
Compare
Choose a tag to compare

Changed

  • Calling Icicle\Stream\WritablePipe::end() now calls stream_socket_shutdown() on the stream resource, shutting down the write side of the stream socket.

Fixed

  • Fixed issue where Icicle\Stream\MemoryStream would sometimes discard data written to it before being read.

v0.5.4

30 Dec 04:27
Compare
Choose a tag to compare

Added

  • Icicle\Stream\Pipe\ReadablePipe, Icicle\Stream\Pipe\WritablePipe, and Icicle\Stream\Pipe\DuplexPipe will automatically free resources in the event loop associated with the stream and call fclose() on the stream resource when the object is destructed. This means close() does not need to be called on the stream to avoid memory leaks in the loop or close the stream resource. The constructors of these classes have an additional boolean parameter $autoClose that defaults to true, but can be set to false to avoid automatically calling fclose() on the stream resource.

Fixed

  • Fixed an issue where only the timeout of the last write would be used if there was a queue of pending writes in Icicle\Stream\Pipe\WritablePipe.

v0.5.3

21 Dec 04:43
Compare
Choose a tag to compare

Added

  • Added an unshift() method to Icicle\Stream\MemoryStream, Icicle\Stream\Pipe\ReadablePipe, and Icicle\Stream\Pipe\DuplexPipe that puts data at the front of the stream. The data given to this method will be the first data read for any pending or subsequent read.

Changed

  • Simultaneous reads are now allowed on readable streams, fulfilling in the order they were created. Simultaneous reads will not fulfill with the same data, rather each is fulfilled independently with new data read from the stream.

v0.5.2

11 Dec 20:51
Compare
Choose a tag to compare

Fixed

  • Fixed an issue where a stream that ended itself (made itself unwritable) would then be closed when using Icicle\Stream\pipe() with the $end parameter set to true.

v0.5.1

09 Dec 17:08
Compare
Choose a tag to compare

Fixed

  • The Icicle\Stream\pipe() function also closed the source stream if $end was true, though this was not the intended behavior. This has now been fixed, only the destination stream is ended (closed).

v0.5.0

03 Dec 22:59
Compare
Choose a tag to compare

Changes

  • All interface names have been changed to remove the Interface suffix. Most interfaces simply had the suffix removed, except for Icicle\Stream\StreamResourceInterface, which was renamed to Icicle\Stream\Resource and no longer extends Icicle\Stream\Stream.
  • Calling close() on a readable stream when there is a pending read operation will now fulfill the read with an empty string instead of rejecting.

v0.4.3

03 Nov 05:00
Compare
Choose a tag to compare

New Features

  • Added a rebind() method to the pipe classes that rebinds the object to the current event loop instance. This method should be used if the event loop is switched out during runtime (for example, when forking using the concurrent package).

Bug Fixes

  • Fixed issue in Icicle\Stream\Pipe\ReadablePipe where certain stream resources would cause a warning to be issued if the stream was unexpectedly closed.

v0.4.2

01 Nov 16:33
Compare
Choose a tag to compare

Changes

  • Setting the third parameter of Stream\pipe() to true will now also close the source stream when piping completes.

v0.4.1

19 Oct 23:03
Compare
Choose a tag to compare

Bug Fixes

  • Fixed issue in Icicle\Stream\Pipe\ReadablePipe where reading might fail if the other end of the pipe is closed.

v0.4.0

16 Oct 19:53
Compare
Choose a tag to compare

New Features

  • Added \Icicle\Stream\StreamResourceInterface and \Icicle\Stream\StreamResource as a basis for classes working with PHP stream resources.
  • Added \Icicle\Stream\Pipe\ReadablePipe, \Icicle\Stream\Pipe\WritablePipe, and \Icicle\Stream\Pipe\DuplexPipe for using a PHP stream resource as a non-blocking stream (only compatible with streams from pipes and sockets, not files).
  • Functions for accessing streams for STDIN, STDOUT, and STDERR were added, \Icicle\Stream\stdin(),\Icicle\Stream\stdout(), \Icicle\Stream\stderr().
  • Functions for reading from streams more easily were added: \Icicle\Stream\readTo(), \Icicle\Stream\readUntil(), and \Icicle\Stream\readAll().
  • Added \Icicle\Stream\pair() function that returns a pair of connected stream resources (useful with DuplexPipe).
  • \Icicle\Stream\Text\TextReader and \Icicle\Stream\Text\TextWriter added for reading and writing streams of text in a given character encoding. These classes contain convenience methods for reading or writing based on characters rather than bytes.

Changes

  • pipe() is no longer a method of \Icicle\Stream\ReadableStreamInterface. Use the function \Icicle\Stream\pipe() for the same functionality.
  • Renamed \Icicle\Stream\Stream to \Icicle\Stream\MemoryStream and \Icicle\Stream\Sink to \Icicle\Stream\MemorySink.