OptimalBits / bull

Premium Queue package for handling distributed jobs and messages in NodeJS.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[question] Peek back and front on same Queue from Two workers

TonyLst opened this issue · comments

I would like to know if there is a way to "peek" both front and back on a given LIFO QUEUE.

1 LIFO Queue
1 Simple worker on the LIFO Queue
1 "Kicked outs" worker on the LIFO Queue that peek jobs from back when the queue contains at least 2 elements.

In other words: i would like to be able to set LIFO/FIFO rule on worker rather than setting it to the Queue, and set minimal FIFO processing to 2 on FIFO worker.

The goal is to make sur that only the last LIFO element is processed while others are just sent to the "Kicked outs" queue which will actually make "nothing done" acknowledgment for all.
Acknowledgment because stored objets are Socket.io events.