Exception
2 years ago
Promise
2 years ago
Exception.php
2 years ago
HttpAsyncClient.php
2 years ago
HttpClient.php
2 years ago
HttpAsyncClient.php
28 lines
| 1 | <?php |
| 2 | |
| 3 | namespace AmeliaHttp\Client; |
| 4 | |
| 5 | use AmeliaHttp\Promise\Promise; |
| 6 | use AmeliaPsr\Http\Message\RequestInterface; |
| 7 | |
| 8 | /** |
| 9 | * Sends a PSR-7 Request in an asynchronous way by returning a Promise. |
| 10 | * |
| 11 | * @author Joel Wurtz <joel.wurtz@gmail.com> |
| 12 | */ |
| 13 | interface HttpAsyncClient |
| 14 | { |
| 15 | /** |
| 16 | * Sends a PSR-7 request in an asynchronous way. |
| 17 | * |
| 18 | * Exceptions related to processing the request are available from the returned Promise. |
| 19 | * |
| 20 | * @param RequestInterface $request |
| 21 | * |
| 22 | * @return Promise Resolves a PSR-7 Response or fails with an AmeliaHttp\Client\Exception. |
| 23 | * |
| 24 | * @throws \Exception If processing the request is impossible (eg. bad configuration). |
| 25 | */ |
| 26 | public function sendAsyncRequest(RequestInterface $request); |
| 27 | } |
| 28 |