hydra-node
Safe HaskellSafe-Inferred
LanguageGHC2021

Hydra.Events.Rotation

Synopsis

Documentation

newtype RotationConfig Source #

Constructors

RotateAfter (Positive Natural) 

data EventStore e m Source #

An EventSource and EventSink combined

Constructors

EventStore 

Fields

newRotatedEventStore Source #

Arguments

:: (HasEventId e, MonadUnliftIO m, MonadTime m, MonadLabelledSTM 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.