OptimalBits / bull

Premium Queue package for handling distributed jobs and messages in NodeJS.
Other
15.54k stars 1.43k forks source link

[Question] Get Queue status #969

Closed diegogvieira closed 6 years ago

diegogvieira commented 6 years ago

How can I get status from a queue ? Thanks.

manast commented 6 years ago

What do you mean with "queue status" ?

diegogvieira commented 6 years ago

Hi, For now I am storing my queues inside an array. But when the application is shutdown, the queues are not deleted, they remain inside redis. I would like to check my queues on application first start, and then initialize my array with those queues that were not previous deleted. I do not know if I am being clear enough. One more thing, how can I check if my queue were correctly built?

manast commented 6 years ago

Queues are not "created". You add jobs to them and the jobs are moved to different redis data structures during their lifetime. So there is not really an answer to your questions as they are formulated...

diegogvieira commented 6 years ago

I do not agree. Obviously queues are created... Let me try to be clear: Step1 : Create queue (I did not understand what you said about queues not being created) Step2: Add Jobs Step3: Close app beforing processing all jobs Step4: Restart app Step5: Create a new queue with the same name Step6: Token changes, name remain the same Step7: Remaining unprocessed jobs starts to be processed

I do not undertsand: 1 - Why token changes, but the queue is the same, it pulls "old" jobs. If I need to control my queue using the token, my integrity is compromised. I cannot guarantee the token provided to the client consuming my service(we provide queue management for other services). To add a new job, you need to inform the token. 2 - My problem is basically integrity across queues. I cannot have "lost queues".

Sorry if I am not being clear enough. Maybe the problem itself is about pattern usage, instead bull mechanism.

manast commented 6 years ago

token is a private variable used for event handling, why do you care about that?