Lines Matching refs:request

32  * A request dispatch queue with a thread pool of dispatchers.
45 * Staging area for requests that already have a duplicate request in flight.
48 * <li>containsKey(cacheKey) indicates that there is a request in flight for the given cache
50 * <li>get(cacheKey) returns waiting requests for the given cache key. The in flight request
72 /** Number of network request dispatcher threads to start. */
172 public boolean apply(Request<?> request);
181 for (Request<?> request : mCurrentRequests) {
182 if (filter.apply(request)) {
183 request.cancel();
199 public boolean apply(Request<?> request) {
200 return request.getTag() == tag;
207 * @param request The request to service
208 * @return The passed-in request
210 public Request add(Request request) {
211 // Tag the request as belonging to this queue and add it to the set of current requests.
212 request.setRequestQueue(this);
214 mCurrentRequests.add(request);
218 request.setSequence(getSequenceNumber());
219 request.addMarker("add-to-queue");
221 // If the request is uncacheable, skip the cache queue and go straight to the network.
222 if (!request.shouldCache()) {
223 mNetworkQueue.add(request);
224 return request;
227 // Insert request into stage if there's already a request with the same cache key in flight.
229 String cacheKey = request.getCacheKey();
231 // There is already a request in flight. Queue up.
236 stagedRequests.add(request);
242 // Insert 'null' queue for this cacheKey, indicating there is now a request in
245 mCacheQueue.add(request);
247 return request;
252 * Called from {@link Request#finish(String)}, indicating that processing of the given request
255 * <p>Releases waiting requests for <code>request.getCacheKey()</code> if
256 * <code>request.shouldCache()</code>.</p>
258 void finish(Request request) {
261 mCurrentRequests.remove(request);
264 if (request.shouldCache()) {
266 String cacheKey = request.getCacheKey();
274 // that's not a problem as the cache has been primed by 'request'.