java - Parallel HTTP requests with Retrofit -


I have an Android app that currently creates volley network requests and downloaded images With NetworkImageView is being used to show

I would like to test the capabilities of Retrofit and since I have to run a lot of requests (thousands), I'm concerned about a little parallel execution volley RequestQueue which limits concurrent running requests to four, while others are waiting to execute the requests. In the Retrofit documentation, I have not found any way to handle the number of concurrent requests and I suspect that this information has been left to the developer in this library.

Is that correct? If so, is there an Android-oriented implementation / library available? Otherwise, what are the best practices for handling parallel requests?

Uses an digitizer for retrieiting queuing requests.

Default Executor. NewcachedThreadPool uses which allows for unlimited threads. This usually fits more use cases than you usually have one or two requests at once.

You can change this behavior, however, RestAdapter . Call and pass in an executable that uses a limited thread pool (limited to whatever you want). For the second argument, just give a new example so that the callback is on the main thread.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -