After following this answer here : answer how to limit retrofit network calls
I am doing this:
RestAdapter restAdapter = new RestAdapter.Builder()
.setEndpoint(url)
.setExecutors(Executors.newFixedThreadPool(5),
new MainThreadExecutor())
.setClient(new OkClient())
.build();
To test that this is working, i run a for loop, from 0 to 1000, where in each iteration i fire a request. However, instead of only 5 requests being sent at every given moment, the app fires all 1000 of them at the same time. What am I doing wrong?