Lines Matching refs:request

34  * A request dispatch queue with a thread pool of dispatchers.
47 * Staging area for requests that already have a duplicate request in flight.
50 * <li>containsKey(cacheKey) indicates that there is a request in flight for the given cache
52 * <li>get(cacheKey) returns waiting requests for the given cache key. The in flight request
74 /** Number of network request dispatcher threads to start. */
174 public boolean apply(Request<?> request);
183 for (Request<?> request : mCurrentRequests) {
184 if (filter.apply(request)) {
185 request.cancel();
201 public boolean apply(Request<?> request) {
202 return request.getTag() == tag;
208 * Drains this request queue. All requests currently being processed
218 * Drains this request queue. All requests currently being processed
221 * @param sequenceNumber The sequence number of the drain request. Everything before this number
249 for (Request request : pending) {
250 if (request.isDrainable() && request.getSequence() < sequenceNumber) {
251 request.cancel();
253 // Put the request back on the queue. If it is canceled, it
255 queue.add(request);
261 * @param request The request to service
262 * @return The passed-in request
264 public Request add(Request request) {
265 // Tag the request as belonging to this queue and add it to the set of current requests.
266 request.setRequestQueue(this);
268 mCurrentRequests.add(request);
272 request.setSequence(sSequenceGenerator.incrementAndGet());
273 request.addMarker("add-to-queue");
275 // If the request is uncacheable, skip the cache queue and go straight to the network.
276 if (!request.shouldCache()) {
277 mNetworkQueue.add(request);
278 return request;
281 // Insert request into stage if there's already a request with the same cache key in flight.
283 String cacheKey = request.getCacheKey();
285 // There is already a request in flight. Queue up.
290 stagedRequests.add(request);
296 // Insert 'null' queue for this cacheKey, indicating there is now a request in
299 mCacheQueue.add(request);
301 return request;
306 * Called from {@link Request#finish(String)}, indicating that processing of the given request
309 * <p>Releases waiting requests for <code>request.getCacheKey()</code> if
310 * <code>request.shouldCache()</code>.</p>
312 void finish(Request request) {
315 mCurrentRequests.remove(request);
318 if (request.shouldCache()) {
320 String cacheKey = request.getCacheKey();
328 // that's not a problem as the cache has been primed by 'request'.