StrategyInterface
in
Interface for classes defining the strategy used to calculate an hash out of keys extracted from supported commands.
This is mostly useful to support clustering via client-side sharding.
Tags
Table of Contents
- getDistributor() : DistributorInterface
- Returns a distributor instance to be used by the cluster.
- getSlot() : int
- Returns a slot for the given command used for clustering distribution or NULL when this is not possible.
- getSlotByKey() : int
- Returns a slot for the given key used for clustering distribution or NULL when this is not possible.
Methods
getDistributor()
Returns a distributor instance to be used by the cluster.
public
getDistributor() : DistributorInterface
Return values
DistributorInterface —getSlot()
Returns a slot for the given command used for clustering distribution or NULL when this is not possible.
public
getSlot(CommandInterface $command) : int
Parameters
- $command : CommandInterface
-
Command instance.
Return values
int —getSlotByKey()
Returns a slot for the given key used for clustering distribution or NULL when this is not possible.
public
getSlotByKey(string $key) : int
Parameters
- $key : string
-
Key string.