| Safe Haskell | Safe-Inferred |
|---|---|
| Language | GHC2021 |
Hydra.Events.Rotation
Synopsis
- newtype RotationConfig = RotateAfter Natural
- type LogId = EventId
- data EventStore e m = EventStore {
- eventSource :: EventSource e m
- eventSink :: EventSink e m
- rotate :: LogId -> e -> m ()
- newRotatedEventStore :: (HasEventId e, MonadSTM m, MonadUnliftIO m, MonadTime m) => RotationConfig -> s -> (s -> e -> s) -> (s -> EventId -> UTCTime -> e) -> EventStore e m -> m (EventStore e m)
Documentation
newtype RotationConfig Source #
Constructors
| RotateAfter Natural |
data EventStore e m Source #
An EventSource and EventSink combined
Constructors
| EventStore | |
Fields
| |
Arguments
| :: (HasEventId e, MonadSTM m, MonadUnliftIO m, MonadTime m) | |
| => RotationConfig | |
| -> s | Starting state of aggregate |
| -> (s -> e -> s) | Update aggregate state |
| -> (s -> EventId -> UTCTime -> e) | Create a checkpoint event |
| -> EventStore e m | |
| -> m (EventStore e m) |
Creates an event store that rotates according to given config and StateAggregate.