Closed yehonatanz closed 4 years ago
Interesting. I would need to look to see if the transaction is handled in code or in the Lua script - if in code, this should be doable I would think...
Good news! I just checked, deleteMessage
uses only a simple transaction with two commands (zrem
and hdel
).
Exposing this transaction should be pretty simple.
I will submit a POC PR.
This should be released with 0.4.4+ (somehow Travis/Pypi refused to release it, checking on it now)
The
deleteMessage
command serves as an ACK that signals a job is done. In some cases (mine included), the worker ACKing the job also writes its output to the same redis instance holding the queue. In such cases, it would be great if writing a job's output and ACKing it will happen within the same transaction, to provide the ultimate atomicity guarantee. I propose the following syntax:Where
tx
is aPipeline
instace pre-populated with thedeleteMessage
commands and is executed upon__exit__