PHP code example of react / eep

1. Go to this page and download the library: Download react/eep library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

react / eep example snippets



ues = 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);
}