taskiq-python / taskiq

Distributed task queue with full async support
MIT License
866 stars 52 forks source link

Added on_send_error middleware hook #360

Open hawang-wish opened 2 months ago

hawang-wish commented 2 months ago

Hi,

I am currently working on a retrying feature to ensure the delivery of messages when the queue service is unstable. I found that it could be really helpful to have this on_send_error so that we can store the failed message and retry later.

I've also added a bool return to make it able to mute exceptions so that we don't have to try-catch the kicking everywhere.

The execution order of on_send_error is reversed, just like what I suggested in https://github.com/taskiq-python/taskiq/pull/359 .

Please let me know if you have some ideas, suggestions or concerns, and big thanks in advance!

s3rius commented 2 weeks ago

Can you please doc entry about this functionality in docs folder?