public final class RealApolloPrefetch extends java.lang.Object implements ApolloPrefetch
ApolloPrefetch.Callback, ApolloPrefetch.Factory| Constructor and Description |
|---|
RealApolloPrefetch(com.apollographql.apollo.api.Operation operation,
okhttp3.HttpUrl serverUrl,
okhttp3.Call.Factory httpCallFactory,
HttpCache httpCache,
com.squareup.moshi.Moshi moshi,
java.util.concurrent.ExecutorService dispatcher,
ApolloLogger logger,
ApolloCallTracker callTracker) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Cancels the operation.
|
ApolloPrefetch |
clone()
Creates a new, identical ApolloPrefetch to this one which can be enqueued or executed even if this one has already
been executed.
|
ApolloPrefetch |
enqueue(ApolloPrefetch.Callback responseCallback)
Schedules the request to be executed at some point in the future.
|
void |
execute()
Sends the request immediately and blocks until the response can be processed or is an error.
|
boolean |
isCanceled()
Checks if this operation has been canceled.
|
com.apollographql.apollo.api.Operation |
operation()
Returns GraphQl operation this call executes
|
public RealApolloPrefetch(com.apollographql.apollo.api.Operation operation,
okhttp3.HttpUrl serverUrl,
okhttp3.Call.Factory httpCallFactory,
HttpCache httpCache,
com.squareup.moshi.Moshi moshi,
java.util.concurrent.ExecutorService dispatcher,
ApolloLogger logger,
ApolloCallTracker callTracker)
public void execute()
throws ApolloException
ApolloPrefetchexecute in interface ApolloPrefetchApolloException - if the request could not be executed due to a cancellation, a timeout or a network
failure@Nonnull public ApolloPrefetch enqueue(@Nullable ApolloPrefetch.Callback responseCallback)
ApolloPrefetchenqueue in interface ApolloPrefetchresponseCallback - Callback which will handle the success response or a failure exception@Nonnull public com.apollographql.apollo.api.Operation operation()
ApolloPrefetchoperation in interface ApolloPrefetchOperationpublic ApolloPrefetch clone()
ApolloPrefetchclone in interface ApolloPrefetchclone in class java.lang.Objectpublic void cancel()
Cancelablecancel in interface Cancelablepublic boolean isCanceled()
CancelableisCanceled in interface Cancelable