MCPcopy Create free account
hub / github.com/InterviewReady/Low-Level-Design / acceptRequest

Method acceptRequest

LoadBalancer.java:90–97  ·  view source on GitHub ↗
(Request request)

Source from the content-addressed store, hash-verified

88 int threshold;
89
90 public boolean acceptRequest(Request request) {
91 if (threshold <= requestsBeingServed) {
92 requestsBeingServed++;
93 return true;
94 } else {
95 return false;
96 }
97 }
98
99 private void completeRequest(){
100 requestsBeingServed--;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected