February 2018
Intermediate to advanced
552 pages
13h 46m
English
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: