1
0
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:
Márk Sági-Kazár 2018-12-21 17:44:32 +01:00 committed by GitHub
commit c84df5fc88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
},
]);