public final class Dispatcher extends Object
Each dispatcher uses an ExecutorService to run calls internally. If you supply your
own executor, it should be able to run the configured maximum number
of calls concurrently.
| Constructor and Description |
|---|
Dispatcher() |
Dispatcher(ExecutorService executorService) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancelAll() |
void |
enqueue(RealCall.AsyncCall call) |
void |
executed(RealCall call) |
ExecutorService |
executorService() |
void |
finished(RealCall.AsyncCall call) |
void |
finished(RealCall call) |
int |
getMaxRequests() |
int |
getMaxRequestsPerHost() |
List<Call> |
queuedCalls() |
int |
queuedCallsCount() |
List<Call> |
runningCalls() |
int |
runningCallsCount() |
void |
setIdleCallback(Runnable idleCallback) |
void |
setMaxRequests(int maxRequests) |
void |
setMaxRequestsPerHost(int maxRequestsPerHost) |
public Dispatcher(ExecutorService executorService)
public Dispatcher()
public ExecutorService executorService()
public int getMaxRequests()
public void setMaxRequests(int maxRequests)
public int getMaxRequestsPerHost()
public void setMaxRequestsPerHost(int maxRequestsPerHost)
public void setIdleCallback(Runnable idleCallback)
public void enqueue(RealCall.AsyncCall call)
public void cancelAll()
public void executed(RealCall call)
public void finished(RealCall.AsyncCall call)
public void finished(RealCall call)
public int queuedCallsCount()
public int runningCallsCount()
Copyright © 2019. All rights reserved.