From e2c724a1997b12fa2af21f170a4fea6dca3196cc Mon Sep 17 00:00:00 2001 From: Andrea Marco Sartori Date: Tue, 13 Feb 2024 19:01:06 +1000 Subject: [PATCH] Update readme --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 3a39442..108ac98 100644 --- a/README.md +++ b/README.md @@ -287,6 +287,12 @@ If you find yourself implementing the same custom pagination in different projec Paginated APIs differ from each other, so Lazy JSON Pages lets us tweak our HTTP requests specifically for our use case. +By default HTTP requests are sent synchronously. If we want to send more than one request without waiting for the response, we can call the `async()` method and set the number of concurrent requests: + +```php +LazyJsonPages::from($source)->async(requests: 5); +``` + Internally, Lazy JSON Pages uses [Guzzle](https://docs.guzzlephp.org) as its HTTP client. We can customize the client behavior by adding as many [middleware](https://docs.guzzlephp.org/en/stable/handlers-and-middleware.html#middleware) as we need: ```php