tsufeki / react-line-stream

Line-by-line stream reading for React PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React Line Stream

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();

About

Line-by-line stream reading for React PHP

License:MIT License


Languages

Language:PHP 100.0%