go-workers2 icon indicating copy to clipboard operation
go-workers2 copied to clipboard

Requaos/unique jobs

Open requaos opened this issue 5 years ago • 4 comments

requaos avatar Apr 19 '19 15:04 requaos

This feature sat around for awhile and missed out on being included in the store interface... any recommendations on if there are any special methods to add there? maybe a method to get a list of all uniquely enqueued jobs?

requaos avatar Mar 20 '20 20:03 requaos

@stefannegrea Also, since the shift to a store interface, I just removed my modification to the Acknowledge method. If we are enqueueing a unique job, it checks before insert if there is already a job in that queue with the same args. I had code tucked under the Acknowledge method to LRem with a count of 0 so it nukes all elements with that set of args. It was for safety that I put the guard on both ends, but I guess it really only needs it on insert. If we actually wanted that behavior, would you be willing to bend on that interface definition? If so, would you prefer passing an integer directly or a boolean for unique on non-unique?

requaos avatar Mar 20 '20 20:03 requaos

You can merge this whenever you want, if you want.

requaos avatar Mar 31 '20 23:03 requaos

Nice job @requaos! What's the status on getting this in @stefannegrea?

hellozimi avatar Apr 24 '20 13:04 hellozimi