doubov
02/05/2020, 9:33 PMParent
Child A
Child B
Child A needs to send something to Child B without holding it in state inside the Parent. Is there a pattern? Right now I’ve created a Relay/Channel in the Parent, which gets passed into Child B. Child A sends an Output
to Parent, which then gets routed to the Relay/ChannelRay Ryan
02/05/2020, 10:21 PMRay Ryan
02/05/2020, 10:22 PMRay Ryan
02/05/2020, 10:26 PMRay Ryan
02/05/2020, 10:27 PMRay Ryan
02/05/2020, 10:28 PMZach Klippenstein (he/him) [MOD]
02/05/2020, 10:44 PMEric O'Connell
02/05/2020, 11:15 PMEric O'Connell
02/05/2020, 11:16 PMEric O'Connell
02/05/2020, 11:17 PMCurrentDocumentRepository
which would be injected into (say) the root Workflow as well as this leaf node, and the leaf node could change the current document in a worker?Zach Klippenstein (he/him) [MOD]
02/05/2020, 11:38 PMto propagate the changes using outputs would involve the entire hierarchy participatingThis is by design. Forcing the hierarchy to participate makes the data flow very clear and explicit and reduces the amount of magic side effects/“spooky action at a distance” going on. For simple cases it seems like more boilerplate, but keeping workflows more “pure” makes them easy to test and also easy to re-use elsewhere in the hierarchy.
Eric O'Connell
02/05/2020, 11:43 PMEric O'Connell
02/05/2020, 11:43 PMEric O'Connell
02/05/2020, 11:44 PMZach Klippenstein (he/him) [MOD]
02/05/2020, 11:46 PMCurrentDocumentRepository
comes from, who owns it, make sure I’m injecting the right one into everyone who needs it, etc. For one dependency, not a big deal. But as the list grows, it gets very hard to manage (this was actually one of the big problems in our codebase that workflows were designed to solve).Zach Klippenstein (he/him) [MOD]
02/05/2020, 11:47 PMEric O'Connell
02/05/2020, 11:48 PMEric O'Connell
02/05/2020, 11:48 PMEric O'Connell
02/05/2020, 11:48 PMZach Klippenstein (he/him) [MOD]
02/05/2020, 11:50 PMdoubov
02/06/2020, 1:53 AM