Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@
[![NuGet Version](https://img.shields.io/nuget/v/Trax.Effect)](https://www.nuget.org/packages/Trax.Effect/)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)

Effect system for [Trax.Core](https://www.nuget.org/packages/Trax.Core/) — upgrade a bare locomotive into a full commercial train service with journey logging, station services, and dependency injection.
Effect system for [Trax.Core](https://www.nuget.org/packages/Trax.Core/). Upgrades a bare locomotive into a full commercial train service with journey logging, station services, and dependency injection.

## What This Does

`Trax.Core` gives you `Train<TIn, TOut>`: a locomotive that carries cargo through a sequence of stops. That's enough for pure logic, but production services need to know what ran, when it departed, whether it arrived, what it was carrying, and what went wrong if it derailed.

`Trax.Effect` adds the `ServiceTrain<TIn, TOut>` base class a full commercial train service that wraps every journey with:
`Trax.Effect` adds the `ServiceTrain<TIn, TOut>` base class, a full commercial train service that wraps every journey with:

- **Journey logging** a persistent metadata record for each run (state, timing, cargo in, cargo out, derailment details)
- **Station services** pluggable effect providers that fire during execution (data persistence, logging, parameter serialization, progress tracking)
- **DI integration** stops are resolved from `IServiceProvider`, so you get constructor injection out of the box
- **Journey logging**: a persistent metadata record for each run (state, timing, cargo in, cargo out, derailment details)
- **Station services**: pluggable effect providers that fire during execution (data persistence, logging, parameter serialization, progress tracking)
- **DI integration**: stops are resolved from `IServiceProvider`, so you get constructor injection out of the box

## Installation

Expand Down Expand Up @@ -78,7 +78,7 @@ public class CreateUserTrain : ServiceTrain<CreateUserRequest, User>, ICreateUse
}
```

The route syntax is identical to `Train`. The difference is what happens around it `ServiceTrain` automatically opens a journey log when the train departs, updates it when it arrives, persists effect data at each station, and records the derailment details if any stop fails.
The route syntax is identical to `Train`. The difference is what happens around it. `ServiceTrain` automatically opens a journey log when the train departs, updates it when it arrives, persists effect data at each station, and records the derailment details if any stop fails.

Junctions work the same way, with full DI:

Expand Down Expand Up @@ -118,7 +118,7 @@ Think of it as: the train is boarding (`Pending`), in transit (`InProgress`), an
| **JunctionLogger** | Built-in | Logs each junction's execution with optional cargo serialization |
| **JunctionProgress** | Built-in | Tracks per-junction progress and checks for cancellation signals |

Station services compose enable as many as you need:
Station services compose, so enable as many as you need:

```csharp
effects
Expand All @@ -142,7 +142,7 @@ Or use `AddMediator` (from [Trax.Mediator](https://www.nuget.org/packages/Trax.M

## Part of Trax

Trax is a layered framework — each package builds on the one below it. Stop at whatever layer solves your problem.
Trax is a layered framework. Each package builds on the one below it, so stop at whatever layer solves your problem.

```
Trax.Core pipelines, junctions, railway error propagation
Expand Down
Loading