DistrEx.Coordinator.Interface.CompletedStep needs to disappear completely.
Instead, all chained instructions/expressions need to build/result in TargetedInstruction instances.
In order to be able to handle (parallel/sequential) composition uniformly, the CoordinatorInstruction (and it's TargetedInstructions namespace) needs to be moved to the Coordinator.Interface project.
The same goes for OnCoordinator.
Sequential composition should only be possible through a method TargetedInstruction<TArgument, TNextResult> Then(TargetedInstruction<TResult, TNextResult> nextInstruction) (which returns a CoordinatorInstruction<TArgument, TNextResult>) on a TargetedInstruction<TArgument, TResult>.
pc1.Do(...)
.Then(pc2.Do(...))
.Then(pc3.Do(...))
Parallel composition should only be possible through the Coordinator's TargetedInstruction<...> Do(TargetedInstruction<...>...) methods (which return CoordinatorInstruction<...>)
Coordinator.Do(
pc1.Do(...),
pc2.Do(...),
pc3.Do(...))
Applying an argument should only be possible once an entire DistrEx expression (which is a TargetedInstruction<TArgument, TResult> instance) is built, using
its Future<TResult> Invoke(TArgument) method.
DistrEx.Coordinator.Interface.CompletedStepneeds to disappear completely.Instead, all chained instructions/expressions need to build/result in
TargetedInstructioninstances.In order to be able to handle (parallel/sequential) composition uniformly, the
CoordinatorInstruction(and it'sTargetedInstructionsnamespace) needs to be moved to theCoordinator.Interfaceproject.The same goes for
OnCoordinator.Sequential composition should only be possible through a method
TargetedInstruction<TArgument, TNextResult> Then(TargetedInstruction<TResult, TNextResult> nextInstruction)(which returns aCoordinatorInstruction<TArgument, TNextResult>) on aTargetedInstruction<TArgument, TResult>.Parallel composition should only be possible through the
Coordinator'sTargetedInstruction<...> Do(TargetedInstruction<...>...)methods (which returnCoordinatorInstruction<...>)Applying an argument should only be possible once an entire DistrEx expression (which is a
TargetedInstruction<TArgument, TResult>instance) is built, usingits
Future<TResult> Invoke(TArgument)method.