GitHub - ianbarber/eep-php: A React PHP port of EEP.js
A port of Darach Ennis' Embedding Event Processing (eep.js - https://github.com/darach/eep-js) to PHP and React. Take a look at the README there for background and motivation.
<?php require __DIR__.'/../vendor/autoload.php'; $values = array(2, 4, 6, 8, 10, 13, 14, 15, 18, 20, 30, 14, 15, 10, 10, 9, 3); $sum_fn = new React\EEP\Stats\Sum; $tumbling_sum = new React\EEP\Window\Tumbling($sum_fn, count($values)); // Register callback $tumbling_sum->on('emit', function($value) { echo "sum:\t", $value, "\n";}); // Pump data into the tumbling windows foreach($values as $v) { $tumbling_sum->enqueue($v); }
The examples mainly come from Darach's, but also others from my talk on Event Stream Processing in PHP:
To run the test suite, you need PHPUnit.
See LICENSE.