public class

CacheDispatcher

extends Thread
java.lang.Object
   ↳ java.lang.Thread
     ↳ com.android.volley.CacheDispatcher

Class Overview

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.

Summary

[Expand]
Inherited Constants
From class java.lang.Thread
Public Constructors
CacheDispatcher(BlockingQueue<Request<?>> cacheQueue, BlockingQueue<Request<?>> networkQueue, Cache cache, ResponseDelivery delivery)
Creates a new cache triage dispatcher thread.
Public Methods
void quit()
Forces this dispatcher to quit immediately.
void run()
[Expand]
Inherited Methods
From class java.lang.Thread
From class java.lang.Object
From interface java.lang.Runnable

Public Constructors

public CacheDispatcher (BlockingQueue<Request<?>> cacheQueue, BlockingQueue<Request<?>> networkQueue, Cache cache, ResponseDelivery delivery)

Creates a new cache triage dispatcher thread. You must call start() in order to begin processing.

Parameters
cacheQueue Queue of incoming requests for triage
networkQueue Queue to post requests that require network to
cache Cache interface to use for resolution
delivery Delivery interface to use for posting responses

Public Methods

public void quit ()

Forces this dispatcher to quit immediately. If any requests are still in the queue, they are not guaranteed to be processed.

public void run ()