I'll break this post into two parts, because I'm trying to abstract the concept, but will explain my implementation at the end.
I have two workflows, Workflow A and Workflow B. Part of Workflow B relies on the results of Workflow A. They can be executed sequentially and work as intended, but I want to pipeline them. I want the first half of B to occur parallel to A. That means that I need to at a certain point in B wait for the completion results of A. What would be the best way to handle this?
As for my actual use case, I'm writing an update script, and it is composed of two parts.
A.) Uninstall some existing (out of date) applications
B.) Download and reinstall them
The Download portion can occur in parallel with the removal part. I want to call both at the same time, but have B wait to reinstall the apps until after A has successfully removed the older versions. What would be the best way to do this?
What I've considered
Breaking up the "Download" and "reinstall" portion of B into two parts. This makes sense from the perspective of pipelining them, but if I make the "Reinstall" portion publicly available it will cause issues if the "download" portion isn't run first.
Passing the Task object that encompasses the the "uninstall some existing applications" portion to the "download and reinstall" portion and waiting on it's completion, which satisfies dependency injection (as in, process B depends on the completion of Process A) but that seems messy