BaseWorkerPool.d.ts 861 B

123456789101112131415161718192021
  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. */
  7. /// <reference types="node" />
  8. import { PoolExitResult, WorkerInterface, WorkerOptions, WorkerPoolOptions } from '../types';
  9. export default class BaseWorkerPool {
  10. private readonly _stderr;
  11. private readonly _stdout;
  12. protected readonly _options: WorkerPoolOptions;
  13. private readonly _workers;
  14. constructor(workerPath: string, options: WorkerPoolOptions);
  15. getStderr(): NodeJS.ReadableStream;
  16. getStdout(): NodeJS.ReadableStream;
  17. getWorkers(): Array<WorkerInterface>;
  18. getWorkerById(workerId: number): WorkerInterface;
  19. createWorker(_workerOptions: WorkerOptions): WorkerInterface;
  20. end(): Promise<PoolExitResult>;
  21. }