Skip to content

Change JSON stream to always report data events instead of progress, follow strict stream semantics, support backpressure and improve error handling#50

Merged
clue merged 2 commits intoclue:masterfrom
clue-labs:stream-semantics
Sep 18, 2019
Merged

Change JSON stream to always report data events instead of progress, follow strict stream semantics, support backpressure and improve error handling#50
clue merged 2 commits intoclue:masterfrom
clue-labs:stream-semantics

Conversation

@clue
Copy link
Owner

@clue clue commented Sep 18, 2019

// old: all JSON streams use custom "progress" event
$stream = $client->eventsStream();
$stream->on('progress', function ($data) {
    var_dump($data);
});

// new: all streams use default "data" event
$stream = $client->eventsStream();
$stream->on('data', function ($data) {
    var_dump($data);
});

// new: stream follows stream semantics and supports stream composition
$stream = $client->eventsStream();
$stream->pipe($logger);

@clue clue added this to the v0.3.0 milestone Sep 18, 2019
@clue clue merged commit f4a28bf into clue:master Sep 18, 2019
@clue clue deleted the stream-semantics branch September 18, 2019 08:04
@clue clue modified the milestones: v0.3.0, v1.0.0 Sep 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant