MCPcopy Create free account
hub / github.com/cedriking/spark / run

Method run

src/task-queue.ts:12–17  ·  view source on GitHub ↗
(task: Task<T>)

Source from the content-addressed store, hash-verified

10 }
11
12 run<T>(task: Task<T>): Promise<T> {
13 return new Promise((resolve, reject) => {
14 this.tasks.push(() => task().then(resolve).catch(reject));
15 this.runNext();
16 });
17 }
18
19 runPeriodically(task: Task, milliseconds: number): void {
20 let pending = false;

Callers 1

runPeriodicallyMethod · 0.95

Calls 1

runNextMethod · 0.95

Tested by

no test coverage detected