HttpClientRouterInterface.php 691 B

123456789101112131415161718192021222324252627
  1. <?php
  2. declare(strict_types=1);
  3. namespace Http\Client\Common;
  4. use Http\Client\HttpAsyncClient;
  5. use Http\Client\HttpClient;
  6. use Http\Message\RequestMatcher;
  7. use Psr\Http\Client\ClientInterface;
  8. /**
  9. * Route a request to a specific client in the stack based using a RequestMatcher.
  10. *
  11. * This is not a HttpClientPool client because it uses a matcher to select the client.
  12. *
  13. * @author Joel Wurtz <joel.wurtz@gmail.com>
  14. */
  15. interface HttpClientRouterInterface extends HttpClient, HttpAsyncClient
  16. {
  17. /**
  18. * Add a client to the router.
  19. *
  20. * @param ClientInterface|HttpAsyncClient $client
  21. */
  22. public function addClient($client, RequestMatcher $requestMatcher): void;
  23. }