Returning a new call from a then() doesn't extend the original strategy, it creates a new strategy, and then attaches every strategy item (like pipes, thens, catches) after the executing then() to the new strategy. The old strategy completes.
Maybe you want to start a call chain, get a few child facades, and then you want them to be automatically cleaned up when the asynch call chain ends. Right now, you have to explicitly close all your child facades (it IS hierarchical, so you really would only need to close the top level parent facade to cascade to all child facades)
However, there is no overall 'thing' tracking the whole execution of the call chain. Appending to the existing strategy won't work, because it ends when it gets to the first then(). Perhaps some higher abstraction, or refactoring the code to make appending to the existing strategy a possibility instead of using the new one returned from then()?
A strategy is a chain of calls on adapter(s). Once the strategy ends and there is no then(), the chain ends.
Returning a new call from a then() doesn't extend the original strategy, it creates a new strategy, and then attaches every strategy item (like pipes, thens, catches) after the executing then() to the new strategy. The old strategy completes.
Maybe you want to start a call chain, get a few child facades, and then you want them to be automatically cleaned up when the asynch call chain ends. Right now, you have to explicitly close all your child facades (it IS hierarchical, so you really would only need to close the top level parent facade to cascade to all child facades)
However, there is no overall 'thing' tracking the whole execution of the call chain. Appending to the existing strategy won't work, because it ends when it gets to the first then(). Perhaps some higher abstraction, or refactoring the code to make appending to the existing strategy a possibility instead of using the new one returned from then()?