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.
This blog is mainly for developers who are passionate about programming and new tech. Though as the name suggests most of the posts are going to focus java but many posts will focus on common design problems which will be programming language independent. So without further delay let's dive into it .. :)