[Updated] Finished Frontend, Added statushandling to backend and frontend [Todo: session token handling at lvl 2]
This commit is contained in:
@@ -15,10 +15,14 @@ public class QueueService {
|
||||
* Executes them in order, one every 5 seconds (the limit of the external API)
|
||||
* Removes them from the Queue when the request was succesful
|
||||
*/
|
||||
private final BlockingQueue<Request> requests = new LinkedBlockingQueue<>();
|
||||
private final BlockingQueue<Request> requests = new LinkedBlockingQueue<>(5);
|
||||
|
||||
public void addToQueue(Request request) {
|
||||
requests.add(request);
|
||||
/**
|
||||
* Offer automatically doesn't add it to the queue if it is full, so no Exceptions thrown
|
||||
* @return Whether it's possible to add the request to the queue
|
||||
*/
|
||||
public boolean addToQueue(Request request) {
|
||||
return requests.offer(request);
|
||||
}
|
||||
|
||||
public Request popFromQueue() {
|
||||
|
||||
Reference in New Issue
Block a user