Package com.apollographql.apollo
Interface ApolloSubscriptionCall<T>
-
- All Superinterfaces:
Cancelable
- All Known Implementing Classes:
RealApolloSubscriptionCall
public interface ApolloSubscriptionCall<T> extends Cancelable
ApolloSubscriptionCallis an abstraction for a request that has been prepared for subscription.ApolloSubscriptionCallcannot be executed twice, though it can be cancelled. Any updates pushed by server related to provided subscription will be notified viaApolloSubscriptionCall.CallbackIn order to execute the request again, call the
clone()method which creates a newApolloSubscriptionCallobject.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classApolloSubscriptionCall.CachePolicySubscription normalized cache policy.static interfaceApolloSubscriptionCall.Callback<T>Communicates responses from a subscription server.static interfaceApolloSubscriptionCall.FactoryFactory for creatingApolloSubscriptionCallcalls.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ApolloSubscriptionCall<T>cachePolicy(ApolloSubscriptionCall.CachePolicy cachePolicy)Sets the cache policy for response/request cache.ApolloSubscriptionCall<T>clone()Creates a new, identical call to this one which can be executed even if this call has already been.voidexecute(ApolloSubscriptionCall.Callback<T> callback)SendsSubscriptionto the subscription server and starts listening for the pushed updates.-
Methods inherited from interface com.apollographql.apollo.internal.util.Cancelable
cancel, isCanceled
-
-
-
-
Method Detail
-
execute
void execute(@NotNull ApolloSubscriptionCall.Callback<T> callback)SendsSubscriptionto the subscription server and starts listening for the pushed updates. To cancel this subscription call useCancelable.cancel().- Parameters:
callback- which will handle the subscription updates or a failure exception.- Throws:
ApolloCanceledException- when the call has already been canceledjava.lang.IllegalStateException- when the call has already been executed
-
clone
ApolloSubscriptionCall<T> clone()
Creates a new, identical call to this one which can be executed even if this call has already been.- Returns:
- The cloned
ApolloSubscriptionCallobject.
-
cachePolicy
@NotNull ApolloSubscriptionCall<T> cachePolicy(@NotNull ApolloSubscriptionCall.CachePolicy cachePolicy)
Sets the cache policy for response/request cache.- Parameters:
cachePolicy-ApolloSubscriptionCall.CachePolicyto set- Returns:
ApolloSubscriptionCallwith the providedApolloSubscriptionCall.CachePolicy
-
-