Skip to content

Commit a5dff9f

Browse files
README.md update
1 parent 94b31fe commit a5dff9f

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

README.md

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -37,29 +37,3 @@ foreach ($client->get('https://jsonplaceholder.typicode.com/posts/1') as $respon
3737
}
3838
```
3939

40-
## Parallel Requests
41-
42-
```php
43-
<?php
44-
45-
require_once('vendor/autoload.php');
46-
47-
use Async\Http\AsyncHttpClient;
48-
use Async\Http\MultiAsyncHandler;
49-
50-
$client = new AsyncHttpClient();
51-
$multi = new MultiAsyncHandler();
52-
53-
$urls = [
54-
'https://jsonplaceholder.typicode.com/posts/1',
55-
'https://jsonplaceholder.typicode.com/posts/2',
56-
];
57-
58-
foreach ($urls as $url) {
59-
$multi->add(fn() => $client->get($url), function($res) use ($url) {
60-
echo "[$url] => " . substr($res->getBody(), 0, 80) . "\n";
61-
});
62-
}
63-
64-
$multi->run();
65-
```

0 commit comments

Comments
 (0)