Click or drag to resize
Akka.NETIShardAllocationStrategyAllocateShard 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.ActorIActorRef
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: SystemString
The id of the shard to allocate.
currentShardAllocations
Type: IImmutableDictionaryIActorRef, IImmutableListString
All actor refs to ShardRegion and their current allocated shards, in the order they were allocated

Return Value

Type: TaskIActorRef
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