The following classes are available globally.
A paginator is returned whenever a request is scheduled for pagination (see
In contrast to theSee more
Responsepublisher, this instance is no publisher itself. The
Paginator.connect(with:)needs to be called which yields a publisher that emits the responses for successive pagination requests. See the method’s documentation for details.
An instance of the response class is returned whenever a
Requestis scheduled. The response is a
ConnectablePublisherwith the request’s result type as output. In the future, the set of available properties and methods on an instance of the response may be extended.
As there is only a single response no matter the number of subscribers, the response is represented as a class (i.e. it is a shared publisher). Note that the actual scheduling of the request is performed upon the first subscription. Subscribers that subscribe at a later point in time receive the result as soon as it is available and do not send the request again.
Lastly, the class cannot be initialized by the user but is only returned by Squid upon scheduling a request.See more
An instance of the stream class is returned whenever a
StreamRequestis scheduled. The stream publisher produces arbitrarily many values (depending on the messages from the connected peer). The publisher also provides additional
sendmethods to enable bidirectional communication. Note that publisher only errors out if the stream fails and continues to exist if single messages from the peer cause an error. This is the reason for the stream’s output to be of the type
Result. Also note that the publisher never completes.
Note that, in contrast to theSee more
Responsepublisher, this publisher does not replay any messages received.
The backoff retrier is a more complex, stateful retrier that retries a request upon certain failures by waiting a specified period of time defined by its strategy (seeSee more
BackoffRetrier.Strategy). It also defines a maximum duration after which a failed request is deemed unsuccessful.
public class BackoffRetrier : Retrier
The caching service hook caches a server’s response for requests for a specified time and prevents requests from being sent again if they can be served from the cache. Caching is only performed for GET requests as for all other requests, side-effects on the server are assumed.See more
public class CachingServiceHook : ServiceHook