From 445baf26af3d18836e68950051d56abad9bcb783 Mon Sep 17 00:00:00 2001 From: Simon Frings Date: Wed, 25 Aug 2021 13:27:27 +0200 Subject: [PATCH] Update example to new eventloop API --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 28e9006..5332fa4 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,12 @@ built on top of [ReactPHP](https://reactphp.org/). 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: ```php -$file_get_contents = (new Clue\React\Pq\Executor($loop))->fun('file_get_contents'); +fun('file_get_contents'); $file_get_contents(__FILE__)->then(function (string $contents) { echo $contents;