These are chat archives for akkadotnet/akka.net

23rd
Apr 2017
Yip-Yip
@Yip-Yip
Apr 23 2017 01:57
is passing a initial state paramter as the first message from the parent of a actor on creation a antipattern ?? I would like to use DI for the services and i see this as a way to achieve it as the initial state is a runtime value
Yip-Yip
@Yip-Yip
Apr 23 2017 03:30
Also is a factory Service containing top lvl IActorrefs an ok approach or should you really try and steer clear of DI ?
Bartosz Sypytkowski
@Horusiath
Apr 23 2017 06:33
@eddadjei this is not an error, it's just log info
Bartosz Sypytkowski
@Horusiath
Apr 23 2017 06:38
@ayoung akka doesn't keep track of your actors ;) You can think of actor children as part of the state:
  1. You would need to store that child hierarchy somewhere (you don't need to use Akka.Persistence, maybe a simple db request would be enough)
  2. If you're using cluster sharding, config key remember-entities=true will serve similar role (using Akka.Persistence).
  3. If you have a cluster, you could potentially use Akka.DistributedData and store child actors using something like ORSet<>. This set will be replicated over other cluster nodes, so when your actor system will come back up, it just need to Get the value of the ORSet from the corresponding key and restore children based on that data.