Last active
July 13, 2021 04:46
-
-
Save amencke/83157084bfd421a88629a439fba30b92 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def apply(conversationID: ConversationID): Behavior[SessionCommand] = | |
Behaviors.setup[SessionCommand] { context => | |
EventSourcedBehavior[SessionCommand, SessionEvent, ConversationInMemoryState]( | |
persistenceId = PersistenceId.ofUniqueId(conversationID.toString()), | |
emptyState = ConversationInMemoryState( | |
mutable.Map[ConversationID, List[(UserID, String)]]() | |
), | |
commandHandler = { (state, command) => commandHandler(state, command, context) }, | |
eventHandler = { (state, event) => eventHandler(state, event, context) } | |
) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment