packagist saloonphp/saloon v1.1.0
Version v1.1.0 - Asynchronous Requests

latest releases: v3.x-dev, v3.10.0, v3.9.1...
2 years ago

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...
    },
);

Don't miss a new saloon release

NewReleases is sending notifications on new releases.