Skip to Content
Scala Reactive Programming
book

Scala Reactive Programming

by Rambabu Posa
February 2018
Intermediate to advanced
552 pages
13h 46m
English
Packt Publishing
Content preview from Scala Reactive Programming

Step2 – Implement PersistenceActor's receiveRecover

The next step is to provide an implementation for one of the important and mandatory functions (or methods) of PersistentActor trait—receiveRecover. It is defined with the following signature:

def receiveRecover: Receive

This function is also known as the recovery handler. It is used to restore the state of our Persistence Actor from its journal (such as MongoDB, Apache Cassandra, and so on) when an Actor is crashed, started, or restarted by its JVM or its Supervisor. This receiveRecover() function works in one the following two kinds of behaviors:

  • Normal behavior (without the Snapshots feature)When this function is executed, it retrieves all available events related to that Persistence ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Scala Programming Projects

Scala Programming Projects

Mikael Valot, Nicolas Jorand
Learning Scala

Learning Scala

Jason Swartz
Functional Programming in Scala

Functional Programming in Scala

Runar Bjarnason, Paul Chiusano

Publisher Resources

ISBN: 9781787288645Supplemental Content