class Movie::Cluster::WeightedLeastLoadedAllocation

Overview

Balances load relative to caller-supplied positive capacity weights.

Defined in:

movie/cluster/sharding/strategies.cr

Constructors

Instance Method Summary

Instance methods inherited from class Movie::Cluster::ShardAllocationStrategy

allocate(shard_id : Int32, members : Array(Member), current_allocations : ShardAllocations) : UniqueAddress | Nil allocate, configuration_key : String configuration_key

Constructor Detail

def self.new(strategy_id : String = "default", &weight_for : Member -> Int32) #

[View source]

Instance Method Detail

def allocate(shard_id : Int32, members : Array(Member), current_allocations : ShardAllocations) : UniqueAddress | Nil #

[View source]
def configuration_key : String #

[View source]