| 1 |
<?php |
| 2 |
|
| 3 |
namespace Http\Client; |
| 4 |
|
| 5 |
use Http\Promise\Promise; |
| 6 |
use Psr\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 |
* @return Promise resolves a PSR-7 Response or fails with an Http\Client\Exception |
| 21 |
* |
| 22 |
* @throws \Exception If processing the request is impossible (eg. bad configuration). |
| 23 |
*/ |
| 24 |
public function sendAsyncRequest(RequestInterface $request); |
| 25 |
} |
| 26 |
|