-
Notifications
You must be signed in to change notification settings - Fork 618
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
scheduling from Command.end? #6532
Comments
What is scheduling from |
maybe? how do I use select() or either() to assemble an indefinite series of arbitrary commands? |
Something like |
i see, you mean to put the selection logic in the command selector. how do you trap the command completion to select the next one? I think my main question is actually the reasoning behind the comment. why say that chaining commands through end() is a bad idea if it seems to work fine? |
I presume that it isn't recommended as it adds a side effect to the command that is essentially hidden. When you use a factory command you explicitly state that after this command ends this command should run. Compared to end where you are implicitly moving on to it which could cause unintuitive behaviour using something like factory methods as well. |
ok thanks. maybe this is more of a question about canon rather than the specific Command.end idea. I'll ask over on CD. |
Looks like that line was originally added in #2450 (to resolve #2441). However, the behavior that needed to be fixed (scheduling a command with shared requirements from Regarding https://www.chiefdelphi.com/t/canonical-command-chaining/464156 (which I'm guessing is where you asked on CD):
|
in Command.end(), theres a comment that advises against using this method to schedule another command, suggesting andThen(), which I think would only work for a static sequence. I had in mind to use the end() method to do ad hoc command sequencing, and it seems like it should work fine. is there a reason not to?
The text was updated successfully, but these errors were encountered: