I am facing a problem which is due to slow replies from my backend sometimes. In fact, I am using Retrofit + RxAndroid to communicate with my server and when I am doing multiple requests, it seems that only one request is executed at a time. Is there any way to increase this limit to avoid blocking waiting requests ?
Thank you.
edit:
Imagine that I am doing one request to long background process.
retrofitService.getLongBackgroundProcess(url)
.subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(result -> { //doing something with the result });
And at the same time I am doing another request to a service that can respond immediately.
retrofitService.getVeryVeryFastResponse(url)
.subscribeOn(Schedulers.newThread())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(result -> { //doing something with the result });
The first request in my case is blocking the execution of the second request.. This is my problem. Do you know why and what can i do to having both requests executed at the same time ?
Thanks.
It seems that the problem was from neither retrofit nor rxandroid. My backend seems to be the problem.
The backend took too long to send back the response from the request, so I passed my long processing jobs to the background and then replied directly to the users. This is more efficient and doesn't block the available threads on the Android client.
Thank you for your help.