Skip to content

refactor out DistrEx.Coordinator.Interface.CompletedStep #17

Description

@derabbink

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions