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

Method processQueue

pack-manager.js:50–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

48 }
49
50 // Process the request queue with rate limit awareness
51 async processQueue() {
52 if (this.processingQueue || this.requestQueue.length === 0) {
53 return;
54 }
55
56 this.processingQueue = true;
57
58 while (this.requestQueue.length > 0) {
59 const request = this.requestQueue.shift();
60
61 try {
62 // Check rate limit before making request
63 await this.checkRateLimit();
64
65 const response = await this.makeRequestWithRetry(request.url, request.options);
66 this.updateRateLimitInfo(response);
67 request.resolve(response);
68
69 // Small delay between requests to be respectful
70 await this.delay(100);
71
72 } catch (error) {
73 request.reject(error);
74 }
75 }
76
77 this.processingQueue = false;
78 }
79
80 // Check rate limit and wait if necessary

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