A message queue that processes messages in parallel. It takes another MessageQueue, and processes messages in parallel up to a certain number of workers.
Actually, it's rather a decorator than a queue itself.
Note that the workers do not run in truly parallel, in the sense that they are not running in separate threads or processes. They are running in the same process, but are scheduled to run in parallel. Hence, this is useful for I/O-bound tasks, but not for CPU-bound tasks, which is okay for Fedify's workloads.
ParallelMessageQueue(queue: MessageQueue,workers: number,)
Constructs a new ParallelMessageQueue with the given queue and number of workers.
queue: MessageQueue
enqueue(message: any,options?: MessageQueueEnqueueOptions,): Promise<void>
listen(handler: (message: any) => Promise<void> | void,options?: MessageQueueListenOptions,): Promise<void>