Skip to content

Commit

Permalink
Prepare v0.5.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
clue committed Mar 8, 2017
1 parent aea7752 commit 6ccc4bd
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 1 deletion.
69 changes: 69 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,74 @@
# Changelog

## 0.5.0 (2017-03-08)

* Feature / BC break: Consistent `end` event semantics (EOF)
(#70 by @clue)

The `end` event will now only be emitted for a `successful` end, not it the
stream closes due to an unrecoverable `error` event or if it is `close()`d
explicitly.
If you want to detect when the stream closes (terminates), use the `close`
event instead.

* BC break: Remove custom (undocumented) `full-drain` event from `Buffer`
(#63 and #68 by @clue)

> The `full-drain` event was undocumented and mostly used internally.
Relying on this event has attracted some low-quality code in the past, so
we've removed this from the public API in order to work out a better
solution instead.
If you want to detect when the buffer finishes flushing data to the stream,
you may want to look into its `end()` method or the `close` event instead.

* Feature / BC break: Consistent event semantics and documentation,
explicitly state *when* events will be emitted and *which* arguments they
receive.
(#73 and #69 by @clue)

The documentation now explicitly defines each event and its arguments.
Custom events and event arguments are still supported.
Most notably, all defined events only receive inherently required event
arguments and no longer transmit the instance they are emitted on for
consistency and performance reasons.

```php
// old (inconsistent and not supported by all implementations)
$stream->on('data', function ($data, $stream) {
// process $data
});

// new (consistent throughout the whole ecosystem)
$stream->on('data', function ($data) use ($stream) {
// process $data
});
```

> This mostly adds documentation (and thus some stricter, consistent
definitions) for the existing behavior, it does NOT define any major
changes otherwise.
Most existing code should be compatible with these changes, unless
it relied on some undocumented/unintended semantics.

* Feature / BC break: Consistent method semantics and documentation
(#72 by @clue)

> This mostly adds documentation (and thus some stricter, consistent
definitions) for the existing behavior, it does NOT define any major
changes otherwise.
Most existing code should be compatible with these changes, unless
it relied on some undocumented/unintended semantics.

* Feature: Consistent `pipe()` semantics for closed and closing streams
(#71 from @clue)

The source stream will now always be `pause()`d when the destination stream
closes. Also, properly stop piping if the source stream closes and remove
all event forwarding.

* Improve test suite by adding PHPUnit to `require-dev` and improving coverage.
(#74 and #75 by @clue, #66 by @nawarian)

## 0.4.6 (2017-01-25)

* Feature: The `Buffer` can now be injected into the `Stream` (or be used standalone)
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ descriptor based implementation with an in-memory write buffer.
* [Usage](#usage)
* [Install](#install)
* [Tests](#tests)
* [License](#license)

## API

Expand Down Expand Up @@ -711,7 +712,7 @@ The recommended way to install this library is [through Composer](http://getcomp
This will install the latest supported version:

```bash
$ composer require react/stream:^0.4.6
$ composer require react/stream:^0.5
```

More details about version upgrades can be found in the [CHANGELOG](CHANGELOG.md).
Expand All @@ -730,3 +731,7 @@ To run the test suite, go to the project root and run:
```bash
$ php vendor/bin/phpunit
```

## License

MIT, see [LICENSE file](LICENSE).

0 comments on commit 6ccc4bd

Please sign in to comment.