Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- type TaskManager event action st = Aggregator event ([Task action], st)
- data Task action = Task {}
- runTaskManager :: forall streamFamily action st m. (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) -> TaskManager (EventWithContext' (StreamType streamFamily)) action st -> (action -> m ()) -> m ()
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.
A task as accumulated by a TaskManager
.
:: (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.