|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.android.volley.RequestQueue
public class RequestQueue
A request dispatch queue with a thread pool of dispatchers.
Calling add(Request)
will enqueue the given Request for dispatch,
resolving from either cache or network on a worker thread, and then delivering
a parsed response on the main thread.
Nested Class Summary | |
---|---|
static interface |
RequestQueue.RequestFilter
A simple predicate or filter interface for Requests, for use by cancelAll(RequestFilter) . |
Constructor Summary | |
---|---|
RequestQueue(Cache cache,
Network network)
Creates the worker pool. |
|
RequestQueue(Cache cache,
Network network,
int threadPoolSize)
Creates the worker pool. |
|
RequestQueue(Cache cache,
Network network,
int threadPoolSize,
ResponseDelivery delivery)
Creates the worker pool. |
Method Summary | |
---|---|
Request |
add(Request request)
Adds a Request to the dispatch queue. |
void |
cancelAll(Object tag)
Cancels all requests in this queue with the given tag. |
void |
cancelAll(RequestQueue.RequestFilter filter)
Cancels all requests in this queue for which the given filter applies. |
(package private) void |
finish(Request request)
Called from Request.finish(String) , indicating that processing of the given request
has finished. |
Cache |
getCache()
Gets the Cache instance being used. |
int |
getSequenceNumber()
Gets a sequence number. |
void |
start()
Starts the dispatchers in this queue. |
void |
stop()
Stops the cache and network dispatchers. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RequestQueue(Cache cache, Network network, int threadPoolSize, ResponseDelivery delivery)
start()
is called.
cache
- A Cache to use for persisting responses to disknetwork
- A Network interface for performing HTTP requeststhreadPoolSize
- Number of network dispatcher threads to createdelivery
- A ResponseDelivery interface for posting responses and errorspublic RequestQueue(Cache cache, Network network, int threadPoolSize)
start()
is called.
cache
- A Cache to use for persisting responses to disknetwork
- A Network interface for performing HTTP requeststhreadPoolSize
- Number of network dispatcher threads to createpublic RequestQueue(Cache cache, Network network)
start()
is called.
cache
- A Cache to use for persisting responses to disknetwork
- A Network interface for performing HTTP requestsMethod Detail |
---|
public void start()
public void stop()
public int getSequenceNumber()
public Cache getCache()
Cache
instance being used.
public void cancelAll(RequestQueue.RequestFilter filter)
filter
- The filtering function to usepublic void cancelAll(Object tag)
public Request add(Request request)
request
- The request to service
void finish(Request request)
Request.finish(String)
, indicating that processing of the given request
has finished.
Releases waiting requests for request.getCacheKey()
if
request.shouldCache()
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |