Java 类com.android.volley.ExecutorDelivery 实例源码

项目:Goalie_Android    文件:BaseTest.java   
private RequestQueue newVolleyRequestQueueForTest(final Context context) {
    File cacheDir = new File(context.getCacheDir(), "cache/volley");
    Network network = new BasicNetwork(new HurlStack());
    ResponseDelivery responseDelivery = new ExecutorDelivery(Executors.newSingleThreadExecutor());
    RequestQueue queue = new RequestQueue(new DiskBasedCache(cacheDir), network, 4, responseDelivery);
    queue.start();

    return queue;
}
项目:HappyVolley    文件:HappyRequestQueue.java   
/**
 * 自定义Volley请求Queue
 *
 * @param context Context
 * @return RequestQueue
 */
public RequestQueue newRequestQueue(Context context) {
    File cacheDir = new File(context.getCacheDir(), DEFAULT_CACHE_DIR);
    Network network = new BasicNetwork(new HurlStack());
    RequestQueue queue = new RequestQueue(new DiskBasedCache(cacheDir),
            network,
            DEFAULT_NETWORK_THREAD_POOL_SIZE,
            new ExecutorDelivery(executorService));
    queue.start();
    return queue;
}
项目:wasp    文件:WaspTest.java   
public WaspTest() throws Exception {
  File cacheDir = new File(context.getCacheDir(), "volley");
  Network network = new BasicNetwork(new OkHttpStack(new OkHttpClient()));
  ResponseDelivery delivery = new ExecutorDelivery(executor);
  requestQueue = new RequestQueue(new DiskBasedCache(cacheDir), network, 4, delivery);
  requestQueue.start();

  server.start();
}
项目:eManga    文件:SmartRequestQueue.java   
/**
 * Creates the worker pool. Processing will not begin until {@link #start()} is called.
 *
 * @param cache A Cache to use for persisting responses to disk
 * @param network A Network interface for performing HTTP requests
 * @param threadPoolSize Number of network dispatcher threads to create
 */
public SmartRequestQueue(Cache cache, Network network, int threadPoolSize) {
    this(cache, network, threadPoolSize,
            new ExecutorDelivery(new Handler(Looper.getMainLooper())));
}