Click or drag to resize
Akka.NETIShardAllocationStrategy.AllocateShard Method
Invoked when the location of a new shard is to be decided.

Namespace:  Akka.Cluster.Sharding
Assembly:  Akka.Cluster.Sharding (in Akka.Cluster.Sharding.dll) Version: 1.2.3.42 (1.2.3.42)
Syntax
Task<IActorRef> AllocateShard(
	IActorRef requester,
	string shardId,
	IImmutableDictionary<IActorRef, IImmutableList<string>> currentShardAllocations
)

Parameters

requester
Type: Akka.Actor.IActorRef
Actor reference to the ShardRegion that requested the location of the shard, can be returned if preference should be given to the node where the shard was first accessed.
shardId
Type: System.String
The id of the shard to allocate.
currentShardAllocations
Type: IImmutableDictionary<IActorRef, IImmutableList<String>>
All actor refs to ShardRegion and their current allocated shards, in the order they were allocated

Return Value

Type: Task<IActorRef>
Task of the actor ref of the ShardRegion that is to be responsible for the shard, must be one of the references included in the currentShardAllocations parameter.
See Also