Skip to content

Allow more commands to happen in the same transaction as deleteMessage #9

@yehonatanz

Description

@yehonatanz

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:

with rsmq_instance.deleteMessage(id=message_id).transaction() as tx:
    tx.set("output", output)

Where tx is a Pipeline instace pre-populated with the deleteMessage commands and is executed upon __exit__

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions