Skip to content

Commit

Permalink
Merge pull request reactphp#89 from clue-labs/stream
Browse files Browse the repository at this point in the history
Forward compatibility with Stream v0.5 and upcoming v0.6
  • Loading branch information
WyriHaximus authored Mar 9, 2017
2 parents 8e3cd4f + 1fce343 commit 7dc5721
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,18 @@ you can use any of its events and methods as usual:

```php
$connection->on('data', function ($chunk) {
echo $data;
echo $chunk;
});

$conenction->on('close', function () {
$connection->on('end', function () {
echo 'ended';
});

$connection->on('error', function (Exception $e) {
echo 'error: ' . $e->getMessage();
});

$connection->on('close', function () {
echo 'closed';
});

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"php": ">=5.3.0",
"react/dns": "0.4.*|0.3.*",
"react/event-loop": "0.4.*|0.3.*",
"react/stream": "^0.4.5",
"react/stream": "^0.6 || ^0.5 || ^0.4.5",
"react/promise": "^2.1 || ^1.2",
"react/promise-timer": "~1.0"
},
Expand Down
12 changes: 10 additions & 2 deletions src/ConnectionInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,18 @@
*
* ```php
* $connection->on('data', function ($chunk) {
* echo $data;
* echo $chunk;
* });
*
* $conenction->on('close', function () {
* $connection->on('end', function () {
* echo 'ended';
* });
*
* $connection->on('error', function (Exception $e) {
* echo 'error: ' . $e->getMessage();
* });
*
* $connection->on('close', function () {
* echo 'closed';
* });
*
Expand Down

0 comments on commit 7dc5721

Please sign in to comment.