Skip to content

Commit

Permalink
docs(README): Update client handler setup instructions
Browse files Browse the repository at this point in the history
- Updated comments to reflect new handler setup for the client.
- Changed the way to set the CoroutineHandler and PoolHandler.
- Added an example using a closure to call the HandlerStackFactory.
  • Loading branch information
guanguans committed Sep 9, 2024
1 parent d8f677a commit 6bc0b36
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,9 @@ use Hyperf\Guzzle\HandlerStackFactory;
use Hyperf\Guzzle\PoolHandler;

// Set Handler directly
// $client->setHandler(new PoolHandler);
$client->setHandler(new CoroutineHandler);
// $client->setHandler(make(CoroutineHandler::class));
// $client->setHandler(make(PoolHandler::class));
$client->setHandler((fn () => $this->getHandler($this->option))->call(new HandlerStackFactory));

// Or set HandlerStackResolver
$client->setHandlerStackResolver(static function (Client $client) {
Expand Down

0 comments on commit 6bc0b36

Please sign in to comment.