Train Methods
The members of Train<TInput, TReturn> (Trax.Core), inherited by ServiceTrain<TIn, TOut> (Trax.Effect), that declare a chain inside Junctions(), run a train, and read its chain without running it. The types themselves are under Trains and Junctions.
Declaring a chain
| Method | Description |
|---|
| Junctions | The override that declares the train's chain |
| Chain | Runs a junction, its input from Memory and its output stored back |
| IChain | Runs a junction resolved by its interface from Memory or the container |
| ShortCircuit | Runs a junction whose success becomes the result Resolve returns; its failure is ignored |
| Extract | Copies a member of a Memory value into its own Memory slot |
| AddServices | Stores services in Memory under their interfaces |
| Resolve | Ends the chain, taking the result out of Memory |
Deciding and routing
| Method | Description |
|---|
| Decide | Asks a decider several typed questions about a value in Memory and stores the decisions |
| Switch | Sends the train down one of several tracks, one per enum member |
| Gate | Routes on the probability that a yes/no answer is yes |
| Scale | Routes on where the state falls on an ordered scale |
| Parallel | Runs named branches side by side and joins them |
| Checkpoint | Stores a declared state, so a later run of the same input resumes after it |
Running a train
| Method | Description |
|---|
| Run | Runs the train and throws its failure |
| RunEither | Runs the train and returns its failure as Left |
Reading a chain
| Member | Description |
|---|
| DeclaredChain | Reads the declared chain without running it; ChainVerification.Verify checks it |
| ChainGraph | The declared chain as a graph with stable node ids, canonical JSON and a hash |