Update actor state only after all events are persisted
问题 In the receive method of a persistent actor, I receive a bunch a events I want to persist, and only after all events are persisted, update again my state. How can I do that? def receive: Receive = { ... case NewEvents(events) => persist(events) { singleEvent => // Update state using this single event } // After every events are persisted, do one more thing } Note that the persist() call is not blocking so I cannot put my code just after that. Update: Why I need this These new events come from