MCPcopy Create free account
hub / github.com/ChakshuGautam/stylusdb-sql / processQueue

Method processQueue

src/server.js:17–30  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

15 }
16
17 processQueue() {
18 if (this.isProcessing || this.queue.length === 0) {
19 return;
20 }
21 this.isProcessing = true;
22 const { query, callback, queryId } = this.queue.shift();
23 this.execute(query)
24 .then(result => callback(null, queryId, result))
25 .catch(error => callback(error, queryId))
26 .finally(() => {
27 this.isProcessing = false;
28 this.processQueue();
29 });
30 }
31
32 async execute(query) {
33 if (query.toLowerCase().startsWith('select')) {

Callers 1

server.jsFile · 0.80

Calls 1

executeMethod · 0.95

Tested by

no test coverage detected