MCPcopy Create free account
hub / github.com/subquery/subql / create

Method create

packages/node-core/src/indexer/worker/worker.builder.ts:206–225  ·  view source on GitHub ↗
(
    path: string,
    workerFns: (keyof T)[],
    hostFns: H,
    root: string,
    exitMain = true,
    workerData?: any
  )

Source from the content-addressed store, hash-verified

204 }
205
206 static create<T extends AsyncMethods, H extends AsyncMethods>(
207 path: string,
208 workerFns: (keyof T)[],
209 hostFns: H,
210 root: string,
211 exitMain = true,
212 workerData?: any
213 ): Worker<T> & T {
214 const worker = new Worker(
215 new workers.Worker(path, {
216 argv: [...process.argv, '--root', root],
217 workerData,
218 }),
219 workerFns,
220 hostFns,
221 exitMain
222 );
223
224 return worker as Worker<T> & T;
225 }
226
227 // Host requests are in decreasing ID while Worker is increasing IDs to not conflict
228 protected getReqId(): number {

Callers 3

createWorkerHostFunction · 0.45
createIndexerWorkerFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected