Client Play/Akka Database -> createPayment -> save <- requiresVerification - persistUnverifiedPayment <- requiresVerification // ... waiting for minutes ... -> verifyPayment - verifyPayment -> save
Two Actors are involved: One for save calls, and one for persistance. The persistance Actor is a child of root, because othwerwise it would die together with the save Actor as soon as the requiresVerification response is sent to the client.
We use the AskOf pattern as a facade from Play to the Actor system.
The verifyPayment operation identifies the persistance Actor using its ActorPath, which is stored in a Cookie.
- Errors during persistUnverifiedPayment and verifyPayment are not propagated to the client.
This is because the persistance supervisor does not know who is the asking actor, since its a different one for each operation.
What do you think about this solution, is there a simpler / better way? If not, how can I implement exception propagation to the client with this setup?