public final class Dispatcher
extends java.lang.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(java.util.concurrent.ExecutorService executorService) |
Modifier and Type | Method and Description |
---|---|
void |
cancel(java.lang.Object tag)
Cancel all calls with the tag
tag . |
java.util.concurrent.ExecutorService |
getExecutorService() |
int |
getMaxRequests() |
int |
getMaxRequestsPerHost() |
void |
setMaxRequests(int maxRequests)
Set the maximum number of requests to execute concurrently.
|
void |
setMaxRequestsPerHost(int maxRequestsPerHost)
Set the maximum number of requests for each host to execute concurrently.
|
public Dispatcher(java.util.concurrent.ExecutorService executorService)
public Dispatcher()
public java.util.concurrent.ExecutorService getExecutorService()
public void setMaxRequests(int maxRequests)
If more than maxRequests
requests are in flight when this is
invoked, those requests will remain in flight.
public int getMaxRequests()
public void setMaxRequestsPerHost(int maxRequestsPerHost)
If more than maxRequestsPerHost
requests are in flight when this
is invoked, those requests will remain in flight.
public int getMaxRequestsPerHost()
public void cancel(java.lang.Object tag)
tag
.Copyright © 2014. All Rights Reserved.