MCPcopy Create free account
hub / github.com/babel/babel / constructor

Method constructor

scripts/parallel-tsc/tsc.ts:118–149  ·  view source on GitHub ↗
({
    filename,
    concurrency,
    onTaskStart,
    onTaskDone,
    onTaskError,
    showOutput,
    maxWeight,
    taskWeight,
  }: {
    filename: string;
    concurrency: number;
    onTaskStart: (tasks: string[], weight: number) => void;
    onTaskDone: (
      tasks: string[],
      code: number,
      duration: number
    ) => Promise<void>;
    onTaskError: (tasks: string[]) => void;
    showOutput: (tasks: string[]) => boolean;
    maxWeight: number;
    taskWeight: (task: string) => number;
  })

Source from the content-addressed store, hash-verified

116 #queued = false;
117
118 constructor({
119 filename,
120 concurrency,
121 onTaskStart,
122 onTaskDone,
123 onTaskError,
124 showOutput,
125 maxWeight,
126 taskWeight,
127 }: {
128 filename: string;
129 concurrency: number;
130 onTaskStart: (tasks: string[], weight: number) => void;
131 onTaskDone: (
132 tasks: string[],
133 code: number,
134 duration: number
135 ) => Promise<void>;
136 onTaskError: (tasks: string[]) => void;
137 showOutput: (tasks: string[]) => boolean;
138 maxWeight: number;
139 taskWeight: (task: string) => number;
140 }) {
141 this.#filename = filename;
142 this.#concurrency = concurrency;
143 this.#onTaskStart = onTaskStart;
144 this.#onTaskDone = onTaskDone;
145 this.#onTaskError = onTaskError;
146 this.#showOutput = showOutput;
147 this.#maxWeight = maxWeight;
148 this.#getWeight = taskWeight;
149 }
150
151 run(task: string) {
152 this.#pending.push(task);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected