11# ReactPHP Runtime wrapper for ext-parallel
22
3- [ ![ Linux Build Status ] ( https://travis-ci .com/Reactphp-parallel/runtime.png )] ( https://travis-ci.com/Reactphp-parallel/runtime )
3+ ![ Continuous Integration ] ( https://github .com/Reactphp-parallel/runtime/workflows/Continuous%20Integration/badge.svg )
44[ ![ Latest Stable Version] ( https://poser.pugx.org/React-parallel/runtime/v/stable.png )] ( https://packagist.org/packages/React-parallel/runtime )
55[ ![ Total Downloads] ( https://poser.pugx.org/React-parallel/runtime/downloads.png )] ( https://packagist.org/packages/React-parallel/runtime )
66[ ![ Code Coverage] ( https://scrutinizer-ci.com/g/Reactphp-parallel/runtime/badges/coverage.png?b=master )] ( https://scrutinizer-ci.com/g/Reactphp-parallel/runtime/?branch=master )
7- [ ![ License ] ( https://poser.pugx.org/React -parallel/runtime/license.png )] ( https://packagist.org/packages/react -parallel/runtime )
8- [ ![ PHP 7 ready ] ( http ://php7ready.timesplinter.ch/Reactphp -parallel/runtime/badge.svg )] ( https://travis-ci .org/Reactphp -parallel/runtime )
7+ [ ![ Type Coverage ] ( https://shepherd.dev/github/Reactphp -parallel/runtime/coverage.svg )] ( https://shepherd.dev/github/Reactphp -parallel/runtime )
8+ [ ![ License ] ( https ://poser.pugx.org/React -parallel/runtime/license.png )] ( https://packagist .org/packages/React -parallel/runtime )
99
1010### Installation ###
1111
@@ -18,17 +18,18 @@ composer require react-parallel/runtime
1818# Usage
1919
2020``` php
21- $autoloader = \dirname(__DIR__) . '/vendor/autoload.php';
22- require $autoloader;
21+ use React\EventLoop\Factory;
22+ use ReactParallel\Runtime\Runtime;
23+ use ReactParallel\FutureToPromiseConverter\FutureToPromiseConverter;
2324
2425$loop = Factory::create();
25- $runtime = new Runtime(new FutureToPromiseConverter($loop), $autoloader );
26+ $runtime = Runtime::create (new FutureToPromiseConverter($loop));
2627
2728$runtime->run(function () {
2829 sleep(3);
2930
3031 return 3;
31- })->then (function (int $int): void {
32+ })->done (function (int $int): void {
3233 echo $int, PHP_EOL;
3334});
3435
0 commit comments