Skip to content

feat: forward broker-specific acknowledgement options - #654

Closed
vvanglro wants to merge 1 commit into
taskiq-python:masterfrom
vvanglro:feat/ack-options
Closed

feat: forward broker-specific acknowledgement options#654
vvanglro wants to merge 1 commit into
taskiq-python:masterfrom
vvanglro:feat/ack-options

Conversation

@vvanglro

Copy link
Copy Markdown
Contributor

Summary

  • Allow Context.ack(**kwargs) to forward broker-specific acknowledgement options to the broker callback.
  • Update AckController and AckableMessage callback typing for optional keyword options.
  • Document the callback contract for broker implementers.
  • Add unit and receiver coverage for forwarding delete_after_ack=True through a manual acknowledgement.

Compatibility

Automatic acknowledgements still invoke callbacks without options. Existing brokers with no-argument acknowledgement callbacks therefore continue to work unchanged unless an application explicitly passes broker-specific options through Context.ack(...).

Taskiq intentionally does not define or interpret any option names; their semantics remain broker-specific.

Validation

ruff check taskiq/acks.py taskiq/context.py tests/test_acks.py tests/receiver/test_receiver.py
python -m mypy taskiq/acks.py taskiq/context.py tests/test_acks.py tests/receiver/test_receiver.py
python -m pytest tests/test_acks.py tests/receiver/test_receiver.py -q

Result: 38 passed.

@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.30%. Comparing base (ae2b788) to head (d91f219).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #654   +/-   ##
=======================================
  Coverage   81.29%   81.30%           
=======================================
  Files          69       69           
  Lines        2577     2578    +1     
=======================================
+ Hits         2095     2096    +1     
  Misses        482      482           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vvanglro

Copy link
Copy Markdown
Contributor Author

The original intention of doing this PR was that when I was making the ack for taskiq-redis-streams , I thought it would be possible to control the granularity of whether to delete this ack message.

But just now, while I was taking a shower, I brainstormed and it seems that users don't care about when the messages in the broker are deleted after the task is completed. Therefore, I am closing this PR.

@vvanglro vvanglro closed this Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant