Skip to content

Commit 8a0dcfe

Browse files
committed
Update example to new eventloop API
1 parent e013bfc commit 8a0dcfe

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

README.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ built on top of [ReactPHP](https://reactphp.org/).
88
Once [installed](#install), you can use the following code turn any blocking function (such as PHP's built-in [`file_get_contents()`](https://www.php.net/manual/en/function.file-get-contents.php) function) into a non-blocking one:
99

1010
```php
11-
$file_get_contents = (new Clue\React\Pq\Executor($loop))->fun('file_get_contents');
11+
<?php
12+
13+
require __DIR__ . '/vendor/autoload.php';
14+
15+
$file_get_contents = (new Clue\React\Pq\Executor())->fun('file_get_contents');
1216

1317
$file_get_contents(__FILE__)->then(function (string $contents) {
1418
echo $contents;

0 commit comments

Comments
 (0)