Multiple branches / halting execution of current pipeline #28
hubertlepicki
started this conversation in
Ideas
Replies: 1 comment 3 replies
-
Thank you for clearly expressing your idea and problem you're trying to solve. There is a way to implement the flow control you're describing with the link EntirelyDifferentScenario, unless: :should_run_something?
skip :halt_for_different_scenario, unless: :should_run_something?
step :run_something
link OtherDifferentScenario, unless: :should_run_something1?
skip :halt_for_other_different_scenario, unless: :should_run_something1?
step :run_something1 Is this something which can work in your project? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I suspect my problems are originating in that I am refactoring existing code that is abusing
with
clause, and not writing code from scratch, but I stumbled upon some issues when translating the legacy code to the code that uses Opus pipeline.One feature that would help me is a way to halt the pipeline after I do conditional link. What I currently have is code like this:
I could fairly easily translate that to Opus minus the possibility to halt execution of current pipeline when linking.
For example, the code I would write would be:
But the problem here is that link doesn't halt execution of the current pipeline. I want the other pipeline to basically take over, ignoring any further steps, checks and link in current pipeline.
I can simulate the behavior adding a flag that's being passed between steps that says if the pipeline is halted or not, and provide
unless: :halted?
option to all steps.But maybe that's an useful improvement that I could add to Opus?
The API I came up with would be something like:
i.e. if conditional link was being executed, and it's got
halt: true
option we stop execution of the current pipeline after the link returns.What do you think?
Beta Was this translation helpful? Give feedback.
All reactions