Skip to content

Commit 936814f

Browse files
authored
Update readme example
1 parent 9bd39ff commit 936814f

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

README.md

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,16 @@ composer require react-parallel/runtime
1818
# Usage
1919

2020
```php
21-
use React\EventLoop\Factory;
2221
use ReactParallel\Runtime\Runtime;
23-
use ReactParallel\FutureToPromiseConverter\FutureToPromiseConverter;
22+
use ReactParallel\EventLoop\EventLoopBridge;
2423

25-
$loop = Factory::create();
26-
$runtime = Runtime::create(new FutureToPromiseConverter($loop));
24+
$runtime = Runtime::create(new EventLoopBridge());
2725

28-
$runtime->run(function () {
26+
echo $runtime->run(function (): int {
2927
sleep(3);
3028

3129
return 3;
32-
})->done(function (int $int): void {
33-
echo $int, PHP_EOL;
34-
});
35-
36-
$loop->run();
30+
}), PHP_EOL;
3731
```
3832

3933
## Contributing ##

0 commit comments

Comments
 (0)