Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable callback functions for the Celery dispatcher #15

Open
moiseshiraldo opened this issue Feb 6, 2017 · 1 comment
Open

Enable callback functions for the Celery dispatcher #15

moiseshiraldo opened this issue Feb 6, 2017 · 1 comment

Comments

@moiseshiraldo
Copy link
Contributor

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:

  • functions defined at the top level of a module
  • built-in functions defined at the top level of a module
  • classes that are defined at the top level of a module
  • instances of such classes whose dict or the result of calling getstate() is picklable

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!

moiseshiraldo added a commit to moiseshiraldo/thorn that referenced this issue Feb 6, 2017
ask added a commit that referenced this issue Aug 14, 2019
@saevarom
Copy link
Contributor

saevarom commented Feb 9, 2021

@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.

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

No branches or pull requests

2 participants