1. Go to this page and download the library: Download rx/await 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/ */
rx / await example snippets
//Do some aysnc craziness with observables
$observable = \Rx\Observable::interval(1000);
//Returns a `Generator` with the results of the observable
$generator = \Rx\await($observable);
//You can now use the results like a regular `Iterator`
foreach ($generator as $item) {
//Will block here until the observable completes
echo $item, PHP_EOL;
}