MCPcopy Index your code
hub / github.com/Xyntopia/taskyon / push

Method push

src/modules/taskManager.ts:17–29  ·  view source on GitHub ↗
(item: T)

Source from the content-addressed store, hash-verified

15 private resolveWaitingPop?: (value: T) => void;
16
17 push(item: T) {
18 this.queue.push(item);
19 if (this.resolveWaitingPop) {
20 // Since TypeScript now expects queue.shift() to always return a T,
21 // we need to assure it's not called on an empty array.
22 // The logic ensures it's never empty at this point, but TypeScript doesn't know that.
23 const shiftedItem = this.queue.shift();
24 if (shiftedItem !== undefined) {
25 this.resolveWaitingPop(shiftedItem);
26 }
27 this.resolveWaitingPop = undefined;
28 }
29 }
30
31 count() {
32 return this.queue.length;

Callers 15

extendWebpackFunction · 0.80
scopedExecutionFunction · 0.80
callLLMFunction · 0.80
buildChatFromTaskFunction · 0.80
loadCollectionFunction · 0.80
uploadToIndexFunction · 0.80
queryFunction · 0.80
extractOpenAIFunctionsFunction · 0.80
taskWorkerFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected