Self managing actors - Horusiath/Akkling GitHub Wiki

While Akka.NET gives you a full control over your actors, sometimes you may decide to resign from part of it order to work on simpler conceptual model. This is where Akka.Cluster.Sharding and it's Akkling.Cluster.Sharding extension comes to work.

Akkling cluster sharding introduces few new functions:

  • spawnSharded and spawnShardedAsync work like traditional spawn function with one difference - they take a mapping function as first parameter used to resolve shard and entity ids and also payload itself from sent message. Shard and entity ids are part of sharding mechanism, which allows you to address an actor without having its reference, knowing its location inside the cluster or even knowing if it exists or not. In last case required actor will be created automatically within a shard on one of the provided cluster nodes - usually the less occupied one.

  • spawnShardedProxy and spawnShardedProxyAsync allows you to communicated with actors living inside shards with this difference, that they can live on cluster nodes that don't participate in sharding process themselves.

Go to examples page to see sharded actors in action.