Introducing asynchronous request support for Saloon! There is now a new sendAsnc
method on both the request and the connector and when used, it will return an instance of Guzzle Promise which you can then use in your application.
$request = new GetUserRequest(userId: 1);
$promise = $request->sendAsync();
$promise->then(
function (SaloonResponse $response) {
// Handle successful response...
},
function (SaloonRequestException $exception) {
$response = $exception->getSaloonResponse();
// Handle unsuccessful response...
},
);