Created
February 21, 2020 08:49
-
-
Save ignasi35/9d64c13ab969b21f7ad0eb2f5157a3c0 to your computer and use it in GitHub Desktop.
Manually managed Lagom readside
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class HelloreadSide extends ReadSideProcessor[HelloWorldEvent] { | |
override def aggregateTags: Set[AggregateEventTag[HelloWorldEvent]] = | |
Set(HelloWorldEvent.Tag.tag) | |
override def buildHandler() | |
: ReadSideProcessor.ReadSideHandler[HelloWorldEvent] = { | |
new ReadSideHandler[HelloWorldEvent] { | |
override def globalPrepare(): Future[Done] = Future.successful(Done) | |
// Returns the last Offset processed by this readside processor. | |
override def prepare( | |
tag: AggregateEventTag[HelloWorldEvent] | |
): Future[Offset] = ??? | |
// processes the event and updates the offset | |
override def handle() | |
: Flow[EventStreamElement[HelloWorldEvent], Done, NotUsed] = { | |
Flow[EventStreamElement[HelloWorldEvent]] | |
.mapAsync(1) { eventElement => | |
??? | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment