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

Flow callback function #20

Open
lechat opened this issue Sep 9, 2014 · 1 comment
Open

Flow callback function #20

lechat opened this issue Sep 9, 2014 · 1 comment

Comments

@lechat
Copy link
Contributor

lechat commented Sep 9, 2014

Hi, Lars,

Another suggestion: I have lenghty subflow, and I want to send email once that flow have finished. If I add email function inside with serial(...) - it will be called right when flow is parsed. So I have to make send_email job and call it from flow. Kind of inneficient.

What I suggest is to have an ability to register callback functions with the flow:

with serial(...) as main_flow:
    main_flow.on_success(some_callable)
    main_flow.on_failure(some_other_callable)
    main_flow.invoke('job1')

That way I don't have to do a separate job and can do interesting things from the same script.

Thanks!

Aleksey

@lhupfeldt
Copy link
Owner

Hi Aleksey,

That was on my own wishlist for a long time but other featuress keep creaping in in front of it.
The 'message' method is a little similar (although it does not accept a callback)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants