MCPcopy Create free account
hub / github.com/Coneja-Chibi/CarrotKernel / processQueue

Method processQueue

github-browser.js:67–89  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

65
66 // Process the request queue with rate limit awareness
67 async processQueue() {
68 if (this.processingQueue || this.requestQueue.length === 0) {
69 return;
70 }
71
72 this.processingQueue = true;
73
74 while (this.requestQueue.length > 0) {
75 const request = this.requestQueue.shift();
76
77 try {
78 await this.checkRateLimit();
79 const response = await this.makeRequestWithRetry(request.url, request.options);
80 this.updateRateLimitInfo(response);
81 request.resolve(response);
82 await this.delay(100);
83 } catch (error) {
84 request.reject(error);
85 }
86 }
87
88 this.processingQueue = false;
89 }
90
91 // Check rate limit and wait if necessary
92 async checkRateLimit() {

Callers 1

fetchWithRateLimitMethod · 0.95

Calls 4

checkRateLimitMethod · 0.95
makeRequestWithRetryMethod · 0.95
updateRateLimitInfoMethod · 0.95
delayMethod · 0.95

Tested by

no test coverage detected