Lines Matching defs: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. */
179 public boolean apply(Request<?> request);
188 for (Request<?> request : mCurrentRequests) {
189 if (filter.apply(request)) {
190 request.cancel();
206 public boolean apply(Request<?> request) {
207 return request.getTag() == tag;
214 * @param request The request to service
215 * @return The passed-in request
217 public Request add(Request request) {
218 // Tag the request as belonging to this queue and add it to the set of current requests.
219 request.setRequestQueue(this);
221 mCurrentRequests.add(request);
225 request.setSequence(getSequenceNumber());
226 request.addMarker("add-to-queue");
228 // If the request is uncacheable, skip the cache queue and go straight to the network.
229 if (!request.shouldCache()) {
230 mNetworkQueue.add(request);
231 return request;
234 // Insert request into stage if there's already a request with the same cache key in flight.
236 String cacheKey = request.getCacheKey();
238 // There is already a request in flight. Queue up.
243 stagedRequests.add(request);
249 // Insert 'null' queue for this cacheKey, indicating there is now a request in
252 mCacheQueue.add(request);
254 return request;
259 * Called from {@link Request#finish(String)}, indicating that processing of the given request
262 * <p>Releases waiting requests for <code>request.getCacheKey()</code> if
263 * <code>request.shouldCache()</code>.</p>
265 void finish(Request request) {
268 mCurrentRequests.remove(request);
271 if (request.shouldCache()) {
273 String cacheKey = request.getCacheKey();
281 // that's not a problem as the cache has been primed by 'request'.