mirror of
https://github.com/guzzle/guzzle.git
synced 2025-02-23 09:34:00 +01:00
Merge pull request #2159 from nicolasmure/fix/pool-doc
[Doc] typehint Pool's 'fulfilled' and 'rejected' callbacks
This commit is contained in:
commit
c84df5fc88
@ -200,9 +200,11 @@ amount of requests you wish to send.
|
||||
|
||||
.. code-block:: php
|
||||
|
||||
use GuzzleHttp\Pool;
|
||||
use GuzzleHttp\Client;
|
||||
use GuzzleHttp\Exception\RequestException;
|
||||
use GuzzleHttp\Pool;
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
use GuzzleHttp\Psr7\Response;
|
||||
|
||||
$client = new Client();
|
||||
|
||||
@ -215,10 +217,10 @@ amount of requests you wish to send.
|
||||
|
||||
$pool = new Pool($client, $requests(100), [
|
||||
'concurrency' => 5,
|
||||
'fulfilled' => function ($response, $index) {
|
||||
'fulfilled' => function (Response $response, $index) {
|
||||
// this is delivered each successful response
|
||||
},
|
||||
'rejected' => function ($reason, $index) {
|
||||
'rejected' => function (RequestException $reason, $index) {
|
||||
// this is delivered each failed request
|
||||
},
|
||||
]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user