clue / reactphp-docker

Async, event-driven access to the Docker Engine API, built on top of ReactPHP.
https://clue.engineering/2019/introducing-reactphp-docker
MIT License
107 stars 16 forks source link

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

Closed clue closed 5 years ago

clue commented 5 years ago
// 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);