eventsourcing-0.9.0: CQRS/ES library.

Safe HaskellNone
LanguageHaskell2010

Database.CQRS.TaskManager

Synopsis

Documentation

type TaskManager event action st = Aggregator event ([Task action], st) Source #

Projection aggregating a list of tasks from a stream of events together with some state.

data Task action Source #

A task as accumulated by a TaskManager.

Constructors

Task 

Fields

runTaskManager Source #

Arguments

:: (MonadError Error m, Stream m (StreamType streamFamily), StreamFamily m streamFamily, Hashable (StreamIdentifier streamFamily), MonadIO m, Ord (EventIdentifier (StreamType streamFamily)), Ord (StreamIdentifier streamFamily), Show (EventIdentifier (StreamType streamFamily))) 
=> streamFamily 
-> (StreamIdentifier streamFamily -> st)

Initial state of the task manager for any given stream.

-> TaskManager (EventWithContext' (StreamType streamFamily)) action st 
-> (action -> m ()) 
-> m () 

Repeatedly loop through the streams and run the tasks.

If it finds no work, it waits 5 minutes before the next run or less if it knows of an earlier planned task.