Skip to content

Commit

Permalink
Support guzzle client
Browse files Browse the repository at this point in the history
  • Loading branch information
jenky committed Jul 13, 2023
1 parent 5ae95ae commit edd9e05
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
],
"require": {
"php": "^8.1",
"jenky/atlas": "^0.4"
"jenky/atlas": "^0.5"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.15",
Expand Down
6 changes: 4 additions & 2 deletions src/PoolFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

namespace Jenky\Atlas\Pool;

use GuzzleHttp\ClientInterface;
use Jenky\Atlas\Contracts\ConnectorInterface;
use Jenky\Atlas\Pool\Exceptions\UnsupportedException;
use React\Http\Browser;
use Symfony\Component\HttpClient\Psr18Client;

final class PoolFactory
Expand Down Expand Up @@ -42,8 +42,10 @@ private static function createReactPool(ConnectorInterface $connector): PoolInte

if ($client instanceof Psr18Client) {
$newClient = new React\SymfonyClient();
} elseif ($client instanceof ClientInterface) {
$newClient = new React\GuzzleClient($client);
} else {
$newClient = new React\Client(new Browser());
$newClient = new React\Client();
}

return $connector->withClient($newClient);
Expand Down

0 comments on commit edd9e05

Please sign in to comment.