public interface ApolloSubscriptionCall<T> extends Cancelable
ApolloSubscriptionCall
is an abstraction for a request that has been prepared for subscription.
ApolloSubscriptionCall
cannot be executed twice, though it can be cancelled. Any updates pushed by
server related to provided subscription will be notified via
ApolloSubscriptionCall.Callback
In order to execute the request again, call the clone()
method which creates a new
ApolloSubscriptionCall
object.
Modifier and Type | Interface and Description |
---|---|
static interface |
ApolloSubscriptionCall.Callback<T>
Communicates responses from a subscription server.
|
static interface |
ApolloSubscriptionCall.Factory
Factory for creating
ApolloSubscriptionCall calls. |
Modifier and Type | Method and Description |
---|---|
ApolloSubscriptionCall<T> |
clone()
Creates a new, identical call to this one which can be executed even if this call has already been.
|
void |
execute(ApolloSubscriptionCall.Callback<T> callback)
Sends
Subscription to the subscription server and starts listening for the pushed updates. |
cancel, isCanceled
void execute(@NotNull ApolloSubscriptionCall.Callback<T> callback)
Subscription
to the subscription server and starts listening for the pushed updates. To cancel this
subscription call use Cancelable.cancel()
.callback
- which will handle the subscription updates or a failure exception.ApolloCanceledException
- when the call has already been canceledjava.lang.IllegalStateException
- when the call has already been executedApolloSubscriptionCall<T> clone()
ApolloSubscriptionCall
object.