We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b5c0680 commit 3299becCopy full SHA for 3299bec
RateLimiter.java
@@ -7,9 +7,10 @@
7
import java.util.LinkedList;
8
9
/*
10
- * RATE LIMITER - *SLIDING WINDOW ALGORITHM*
+ * RATE LIMITER - SLIDING WINDOW PER-USER ALGORITHM
11
*/
12
class RateLimiter {
13
+ // user ID : queue of request DTs (phased out of window as-you-go)
14
private HashMap<String, LinkedList<LocalDateTime>> dtQueue;
15
public final int MAX_REQS_PER_MINUTE;
16
// FOR TESTING ONLY (otherwise null)
0 commit comments