Exemple #1
0
<?php

include __DIR__ . "/../../vendor/autoload.php";
$source = new \Rx\React\FromFileObservable(__DIR__ . "/../test.csv");
$source->cut()->map("str_getcsv")->toArray()->subscribe(new \Rx\Observer\CallbackObserver(function (array $array) {
    var_dump($array);
}, function ($e) {
    echo "error\n";
}, function () {
    echo "done\n";
}));
Exemple #2
0
<?php

include __DIR__ . "/../../vendor/autoload.php";
$source = new \Rx\React\FromFileObservable(__DIR__ . "/../test.csv");
$source->cut()->subscribe(new \Rx\Observer\CallbackObserver(function ($data) {
    echo $data . "\n";
}, function ($e) {
    echo "error\n";
}, function () {
    echo "done\n";
}));