private static void drain(RequestQueue paramRequestQueue, int paramInt) { paramRequestQueue.cancelAll(new RequestQueue.RequestFilter() { public final boolean apply(Request<?> paramAnonymousRequest) { if ((paramAnonymousRequest instanceof DfeRequest)) { if (((DfeRequest)paramAnonymousRequest).mAvoidBulkCancel) { return false; } } else if ((paramAnonymousRequest instanceof VendingRequest)) { if (((VendingRequest)paramAnonymousRequest).mAvoidBulkCancel) { return false; } } else if ((paramAnonymousRequest instanceof EscrowRequest)) { return false; } return paramAnonymousRequest.getSequence() < this.val$seq; } }); }
/** * 取消 * @param method * @param api * @param urlParams * @param params */ public void cancel(final int method, final int api, final Object[] urlParams, final Map<String, String> params) { final String targetUrl = buildUrl(method, api, urlParams, params); mRequestQueue.cancelAll(new RequestFilter() { @Override public boolean apply(Request<?> request) { return String.valueOf(request.getTag()) == targetUrl; } }); }
/** * 取消所有请求 */ public void cancel() { mRequestQueue.cancelAll(new RequestFilter() { @Override public boolean apply(Request<?> request) { return (request instanceof BaseRequest); } }); }
/** * 取消所有请求. */ public void cancelAllRequest() { if (mRequestQueue != null) mRequestQueue.cancelAll(new RequestFilter() { @Override public boolean apply(Request<?> request) { return true; } }); }
public final void onDetach() { super.onDetach(); this.mOnRegionCodeSelectedListener = null; cancelPendingAdminAreaMetadataRetrievalRequest(); getRequestQueue().cancelAll(new RequestQueue.RequestFilter() { public final boolean apply(Request<?> paramAnonymousRequest) { return paramAnonymousRequest instanceof CountryMetadataRetrievalTask.CountryMetadataRetrievalRequest; } }); }
protected synchronized void clearRefreshQueue() { volleyRefreshQueue.cancelAll(new RequestFilter() { @Override public boolean apply(com.android.volley.Request<?> request) { return true; } }); }
protected synchronized void clearRequestQueue() { volleyRequestQueue.cancelAll(new RequestFilter() { @Override public boolean apply(com.android.volley.Request<?> request) { return true; } }); }
@Deprecated public void cancelVolleyRquestByObject(final Object obj) { if (mVolleyQueue == null) { return; } mVolleyQueue.cancelAll(new RequestFilter() { @Override public boolean apply(Request<?> request) { if (request.getTag() != null && request.getTag() instanceof VolleyTag) { return ((VolleyTag) request.getTag()).object == obj; } return false; } }); }
@Deprecated public void cancelVolleyRequestAll() { if (mVolleyQueue == null) { return; } mVolleyQueue.cancelAll(new RequestFilter() { @Override public boolean apply(Request<?> request) { return true; } }); }
@Override public void fetch(final VolleyNetworkFetchState fetchState, final Callback callback) { fetchState.submitTime = SystemClock.elapsedRealtime(); final RawRequest request = new RawRequest( fetchState.getUri().toString(), new Response.Listener<byte[]>() { @Override public void onResponse(byte[] bytes) { fetchState.responseTime = SystemClock.uptimeMillis(); try { InputStream is = new ByteArrayInputStream(bytes); callback.onResponse(is, bytes.length); } catch (IOException e) { callback.onFailure(e); } } }, new Response.ErrorListener() { @Override public void onErrorResponse(VolleyError volleyError) { callback.onFailure(volleyError); } }); fetchState.getContext().addCallbacks( new BaseProducerContextCallbacks() { @Override public void onCancellationRequested() { mRequestQueue.cancelAll(new RequestFilter() { @Override public boolean apply(Request<?> candidate) { return candidate != null && request.getSequence() == candidate.getSequence(); } }); } }); mRequestQueue.add(request); }
@Deprecated public void cancelVolleyRequest(RequestFilter filter) { if (mVolleyQueue!=null) { mVolleyQueue.cancelAll(filter); } }
public void cancelRequestQueue(jp.egg.android.request2.okhttp.RequestQueue.RequestFilter filter) { if (mRequestQueue != null) { mRequestQueue.cancelAll(filter); } }
public static void cancelAllRequest(RequestFilter filter){ mQueue.cancelAll(filter); }