From 936814feb34290454cecaf7c773d01a914d8ddd6 Mon Sep 17 00:00:00 2001 From: Cees-Jan Kiewiet Date: Tue, 6 Feb 2024 10:54:15 +0100 Subject: [PATCH] Update readme example --- README.md | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index eb4e5b1..a4d6f91 100644 --- a/README.md +++ b/README.md @@ -18,22 +18,16 @@ composer require react-parallel/runtime # Usage ```php -use React\EventLoop\Factory; use ReactParallel\Runtime\Runtime; -use ReactParallel\FutureToPromiseConverter\FutureToPromiseConverter; +use ReactParallel\EventLoop\EventLoopBridge; -$loop = Factory::create(); -$runtime = Runtime::create(new FutureToPromiseConverter($loop)); +$runtime = Runtime::create(new EventLoopBridge()); -$runtime->run(function () { +echo $runtime->run(function (): int { sleep(3); return 3; -})->done(function (int $int): void { - echo $int, PHP_EOL; -}); - -$loop->run(); +}), PHP_EOL; ``` ## Contributing ##