0

In the current v.1.0 version of Akka.NET it is not possible to combine a FSM approach with persistency from the F# API. I was wondering if it is possible to use a functional approach like this http://bartoszsypytkowski.com/blog/2014/07/05/fsharp-akka-net/ and at the same time hook into the prestart method of actors. That would be one way of implement some kind of "custom" persistency if one can read from persistent storage during the execution of the prestart method.

Any other suggestion on how to use a custom persistent solution are more than welcome.

Nafeez Abrar
  • 1,045
  • 10
  • 27
carstenj
  • 693
  • 5
  • 13

1 Answers1

1

At the moment (Akka.Persistence.FSharp v0.8) there is no way to create an equivalent of the pre started actor execution block. You can read from persistent storage right by defining custom apply method - it automatically receives the most recent snapshots (within SnapshotOffer message) and events from persistent stores.

Bartosz Sypytkowski
  • 7,463
  • 19
  • 36
  • Thanks for the reply. Could you elaborate a bit more a this approach. I am not sure that I understand your suggestion. – carstenj Apr 16 '15 at 14:40
  • The example using recovering from snapshots may be seen [here](https://github.com/akkadotnet/akka.net/blob/dev/src/examples/PersistenceExample.FsApi/Program.fs#L58). I don't know if you check this one already. – Bartosz Sypytkowski Apr 16 '15 at 18:25
  • Thanks. But that approach will not work since I also need the FSM approach. – carstenj Apr 17 '15 at 10:17