MCPcopy
hub / github.com/node-cron/node-cron / constructor

Method constructor

src/coordinator/ipc-run-coordinator.ts:26–35  ·  view source on GitHub ↗
(private channel: IpcChannel)

Source from the content-addressed store, hash-verified

24 private pending = new Map<string, (result: CoordinatorResult) => void>();
25
26 constructor(private channel: IpcChannel) {
27 this.channel.on('message', (message: any) => {
28 if (message?.type !== 'coordinator:result') return;
29 const resolve = this.pending.get(message.reqId);
30 if (resolve) {
31 this.pending.delete(message.reqId);
32 resolve(message);
33 }
34 });
35 }
36
37 shouldRun(key: string, ttlMs: number): Promise<boolean> {
38 const reqId = createID();

Callers

nothing calls this directly

Calls 2

getMethod · 0.80
onMethod · 0.65

Tested by

no test coverage detected