reactphp/react — pull request #100 by igorw (2012-11-18 00:22:22+00:00)
Title: Buffered sink

Depends on #97.

Buffered sink is essentially an async stream_get_contents with a promise-based API. Usage example:

$sink = new BufferedSink();
$sink
->promise()
->then(function ($data) {
echo $data;
});

$conn->pipe($sink);

Once the connection closes, the entire contents of it will be resolved as the value of the promise.