FifoQueue.d.ts 698 B

123456789101112131415161718
  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. import type { QueueChildMessage, TaskQueue } from './types';
  8. /**
  9. * First-in, First-out task queue that manages a dedicated pool
  10. * for each worker as well as a shared queue. The FIFO ordering is guaranteed
  11. * across the worker specific and shared queue.
  12. */
  13. export default class FifoQueue implements TaskQueue {
  14. private _workerQueues;
  15. private _sharedQueue;
  16. enqueue(task: QueueChildMessage, workerId?: number): void;
  17. dequeue(workerId: number): QueueChildMessage | null;
  18. }