tsufeki/react-line-stream

Line-by-line stream reading for React PHP

0.2.1 2018-12-23 23:21 UTC

This package is auto-updated.

Last update: 2020-08-04 19:47:36 UTC


README

Line-by-line stream reading for React PHP.

It's line event gets fired only with single full line of text (EOL included).

Example

$loop = React\EventLoop\Factory::create();
$file = new React\Stream\Stream(fopen('foo.txt', 'r'), $loop);

$lineStream = new ReactLineStream\LineStream($file);
$lineStream->on('line', function ($line) {
    echo 'line: ' . $line;
});

$loop->run();