ihor / RxPHP

Reactive extensions for PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

RxPHP

Reactive extensions for PHP. The reactive extensions for PHP are a set of libraries to compose asynchronous and event-based programs using observable collections and LINQ-style query operators in PHP.

Build Status

Installation

Install dependencies using composer.

$ composer.phar require reactivex/rxphp

Example

$source = \Rx\Observable::fromArray([1, 2, 3, 4]);

$subscription = $source->subscribe(new \Rx\Observer\CallbackObserver(
    function ($x) {
        echo 'Next: ', $x, PHP_EOL;
    },
    function (Exception $ex) {
        echo 'Error: ', $ex->getMessage(), PHP_EOL;
    },
    function () {
        echo 'Completed', PHP_EOL;
    }
));

//Next: 1
//Next: 2
//Next: 3
//Next: 4
//Completed

Quick start for demos

$ composer.phar install

Have fun running the demos in /demo.

License

RxPHP is licensed under the MIT License - see the LICENSE file for details

About

Reactive extensions for PHP

License:MIT License


Languages

Language:PHP 100.0%