public class RealApolloSubscriptionCall<T> extends java.lang.Object implements ApolloSubscriptionCall<T>
ApolloSubscriptionCall.CachePolicy, ApolloSubscriptionCall.Callback<T>, ApolloSubscriptionCall.Factory| Constructor and Description |
|---|
RealApolloSubscriptionCall(com.apollographql.apollo.api.Subscription<?,T,?> subscription,
SubscriptionManager subscriptionManager,
ApolloStore apolloStore,
ApolloSubscriptionCall.CachePolicy cachePolicy,
java.util.concurrent.Executor dispatcher,
ResponseFieldMapperFactory responseFieldMapperFactory,
com.apollographql.apollo.internal.ApolloLogger logger) |
| Modifier and Type | Method and Description |
|---|---|
ApolloSubscriptionCall<T> |
cachePolicy(ApolloSubscriptionCall.CachePolicy cachePolicy)
Sets the cache policy for response/request cache.
|
void |
cancel()
Cancels the operation.
|
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. |
boolean |
isCanceled()
Checks if this operation has been canceled.
|
public RealApolloSubscriptionCall(@NotNull
com.apollographql.apollo.api.Subscription<?,T,?> subscription,
@NotNull
SubscriptionManager subscriptionManager,
@NotNull
ApolloStore apolloStore,
@NotNull
ApolloSubscriptionCall.CachePolicy cachePolicy,
@NotNull
java.util.concurrent.Executor dispatcher,
@NotNull
ResponseFieldMapperFactory responseFieldMapperFactory,
@NotNull
com.apollographql.apollo.internal.ApolloLogger logger)
public void execute(@NotNull
ApolloSubscriptionCall.Callback<T> callback)
throws ApolloCanceledException
ApolloSubscriptionCallSubscription to the subscription server and starts listening for the pushed updates. To cancel this
subscription call use Cancelable.cancel().execute in interface ApolloSubscriptionCall<T>callback - which will handle the subscription updates or a failure exception.ApolloCanceledException - when the call has already been canceledpublic void cancel()
Cancelablecancel in interface Cancelablepublic ApolloSubscriptionCall<T> clone()
ApolloSubscriptionCallclone in interface ApolloSubscriptionCall<T>clone in class java.lang.ObjectApolloSubscriptionCall object.public boolean isCanceled()
CancelableisCanceled in interface Cancelable@NotNull public ApolloSubscriptionCall<T> cachePolicy(@NotNull ApolloSubscriptionCall.CachePolicy cachePolicy)
ApolloSubscriptionCallcachePolicy in interface ApolloSubscriptionCall<T>cachePolicy - ApolloSubscriptionCall.CachePolicy to setApolloSubscriptionCall with the provided ApolloSubscriptionCall.CachePolicy