Releases: icicleio/stream
Releases · icicleio/stream
v0.5.5
v0.5.4
Added
Icicle\Stream\Pipe\ReadablePipe
,Icicle\Stream\Pipe\WritablePipe
, andIcicle\Stream\Pipe\DuplexPipe
will automatically free resources in the event loop associated with the stream and callfclose()
on the stream resource when the object is destructed. This meansclose()
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 totrue
, but can be set tofalse
to avoid automatically callingfclose()
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
Added
- Added an
unshift()
method toIcicle\Stream\MemoryStream
,Icicle\Stream\Pipe\ReadablePipe
, andIcicle\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
v0.5.1
v0.5.0
Changes
- All interface names have been changed to remove the
Interface
suffix. Most interfaces simply had the suffix removed, except forIcicle\Stream\StreamResourceInterface
, which was renamed toIcicle\Stream\Resource
and no longer extendsIcicle\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
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
v0.4.1
v0.4.0
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 withDuplexPipe
). \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
.