com.android.volley
Class CacheDispatcher
java.lang.Object
java.lang.Thread
com.android.volley.CacheDispatcher
- All Implemented Interfaces:
- Runnable
public class CacheDispatcher
- extends Thread
Provides a thread for performing cache triage on a queue of requests.
Requests added to the specified cache queue are resolved from cache.
Any deliverable response is posted back to the caller via a
ResponseDelivery
. Cache misses and responses that require
refresh are enqueued on the specified network queue for processing
by a NetworkDispatcher
.
Method Summary |
void |
quit()
Forces this dispatcher to quit immediately. |
void |
run()
|
Methods inherited from class java.lang.Thread |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
CacheDispatcher
public CacheDispatcher(BlockingQueue<Request> cacheQueue,
BlockingQueue<Request> networkQueue,
Cache cache,
ResponseDelivery delivery)
- Creates a new cache triage dispatcher thread. You must call
Thread.start()
in order to begin processing.
- Parameters:
cacheQueue
- Queue of incoming requests for triagenetworkQueue
- Queue to post requests that require network tocache
- Cache interface to use for resolutiondelivery
- Delivery interface to use for posting responses
quit
public void quit()
- Forces this dispatcher to quit immediately. If any requests are still in
the queue, they are not guaranteed to be processed.
run
public void run()
- Specified by:
run
in interface Runnable
- Overrides:
run
in class Thread