Let's say you have a client-side application. It can be an android application or it can be your java application which invokes 3rd party API internally. And let's say for n number of reasons which are mentioned below, you want to throttle down number API request a time.
How do you do it?
Simple! You need to implement a Request Queue.
What is it?
As the name suggests, it's a queue of Http request. There is a dispatcher thread, which controls how many threads to be executed at a time. It has other functions as well which we are going to discuss later.
Is there an existing implementation ?
Yes, android has Volly library which has it's own implementation of request queue.
However here we will implement a simpler version of request queue.
How do you do it?
Simple! You need to implement a Request Queue.
What is it?
As the name suggests, it's a queue of Http request. There is a dispatcher thread, which controls how many threads to be executed at a time. It has other functions as well which we are going to discuss later.
Is there an existing implementation ?
Yes, android has Volly library which has it's own implementation of request queue.
However here we will implement a simpler version of request queue.
Comments
Post a Comment