disque icon indicating copy to clipboard operation
disque copied to clipboard

RFE: WAITJOB, a blocking operation until the job is ACKed

Open VojtechVitek opened this issue 9 years ago • 9 comments

WAITJOB id timeout - blocks until the job is ACKed or until the timeout is reached

Use case: Multiple consumers waiting on a single job to be done, so they can move on..

VojtechVitek avatar Feb 19 '16 21:02 VojtechVitek

+1 on this

lovelle avatar Feb 19 '16 22:02 lovelle

Out of curiosity, why would multiple consumers be waiting for one job to be processed?

Revisor avatar Feb 23 '16 21:02 Revisor

@Revisor Let's say you have a Travis job and multiple people waiting on the result (UI on the Pull Requests).

VojtechVitek avatar Feb 23 '16 22:02 VojtechVitek

@VojtechVitek Sorry if I'm wrong or if is not what you mean, but you can do GETJOB until timeout is reached.

127.0.0.1:7711> GETJOB TIMEOUT 10000 FROM test
(nil)
(10.07s)

lovelle avatar Feb 24 '16 13:02 lovelle

@lovelle GETJOB gives you next available job from the queue and put it into the "active" state.

WAITJOB would wait on a specific job until it's "acked".

VojtechVitek avatar Feb 24 '16 15:02 VojtechVitek

@VojtechVitek ook, now I get it, sorry for confusion :+1:

lovelle avatar Feb 24 '16 15:02 lovelle

Tacking on to this: in addition to WAITJOB I would like QWAIT as well.

For my use case I queue many jobs (thousands, even millions) in a batch and I need to know when the batch completes. Not just when they're all "active" which I can get from QLEN, but when they have all actually been "acked". Currently there doesn't appear to be any way to do this at all without scanning all jobs directly for their state.

WAITJOB would not be sufficient for this.

dhagrow avatar May 03 '16 17:05 dhagrow

Is there any way to get the job which is acked with the job ID?

jiusanzhou avatar Sep 29 '16 03:09 jiusanzhou

I've build a CI around disque, my solution was to let the job, before completion, send a "I'm done" job to a previously defined status queue.

kaspar030 avatar Mar 02 '17 10:03 kaspar030