Documentation

StrategyInterface

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
author

Daniele Alessandri suppakilla@gmail.com

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

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.

Return values
int

Search results