PHP code example of react-parallel / runtime

1. Go to this page and download the library: Download react-parallel/runtime 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-parallel / runtime example snippets


use ReactParallel\Runtime\Runtime;
use ReactParallel\EventLoop\EventLoopBridge;

$runtime = Runtime::create(new EventLoopBridge());

echo $runtime->run(function (): int {
    sleep(3);

    return 3;
}), PHP_EOL;