I want that if i loop my request it should put it into queue and At a time is should process for 5 request at a time . So How can i implement it. As below I am doing: -
Please help me regarding this
for (int i=0; i<100;i++){
Call
// Call
call.enqueue(new Callback
@Override
public void onResponse(Call
if(response.body()!=null)
{
AppDatabase.getDatabase(getApplicationContext()).storyDao().
insertStoryContentAndImages(response.body().getResult());
}
else
{
}
}
@Override
public void onFailure(Call<GetStoriesByIDTop>call, Throwable t) {
}
});
}
You will have to implement such a specific requirement at the application layer or in a custom CallAdapter.
If you need help doing that, please ask a question on StackOverflow with the 'retrofit' tag which is where we have a small community of people which help resolve usage questions like these.
Most helpful comment
You will have to implement such a specific requirement at the application layer or in a custom CallAdapter.
If you need help doing that, please ask a question on StackOverflow with the 'retrofit' tag which is where we have a small community of people which help resolve usage questions like these.