BaseWorkerPool.d.ts 892 B

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