robinhood / thorn

Easy Webhooks for Python
Other
527 stars 57 forks source link

Enable callback functions for the Celery dispatcher #15

Open moiseshiraldo opened 7 years ago

moiseshiraldo commented 7 years ago

The on_success, on_error and on_timeout callbacks are really useful (e.g. I intend to use them to store/show recent webhook deliveries to the customers, same way GitHub does).

I think it would be safe to enable them for the celery dispatcher if we look at Python's what can be pickled list:

I've done it myself and it's working fine, I've also fixed the corresponding tests (see the commit below). Would you consider merging the branch?

Thank you for your work!

saevarom commented 3 years ago

@moiseshiraldo could you elaborate on how you are using the on_success, on_error and on_timeout callbacks in code? I'm having trouble figuring out where I put these callbacks using ModelEvents and celery dispatcher.