At the time fo this Issue being raised, the eventhandler piepline function (handleEvents) looks like this:
let handleEvents (events:Event seq) =
let _ =
events
|> Seq.filter (fun e -> isValidEvent e.EventType)
|> Seq.map (fun e ->
Logger.writeline $"Processing {e.EventType}" //Only log out the events we are interested in
e)
|> Seq.map (fun e -> DomainEventFactory.CreateDomainEvent e.Payload e.EventType)
|> Seq.map loadState
|> Seq.map handleEvent
|> Seq.map saveState
|> Seq.map postProcessing
|> Seq.iter (fun _ -> () ) //enumerate pipeline
()
What I am wondering is, when we introduced more states, can we somehow reuse this pipeline.
Could loadState and saveState work on a generic?
could handleEvent be passed into handleEvents?
At the time fo this Issue being raised, the eventhandler piepline function (handleEvents) looks like this:
What I am wondering is, when we introduced more states, can we somehow reuse this pipeline.
Could loadState and saveState work on a generic?
could handleEvent be passed into handleEvents?