PHP Interface Predis\Cluster\StrategyInterface

This is mostly useful to support clustering via client-side sharding.
Author: Daniele Alessandri ([email protected])
显示文件 Open project: tillkruss/redis-object-cache Interface Usage Examples

Public Methods

Method Description
getDistributor ( ) : Predis\Cluster\Distributor\DistributorInterface Returns a distributor instance to be used by the cluster.
getSlot ( Predis\Command\CommandInterface $command ) : integer Returns a slot for the given command used for clustering distribution or NULL when this is not possible.
getSlotByKey ( string $key ) : integer Returns a slot for the given key used for clustering distribution or NULL when this is not possible.

Method Details

getDistributor() public method

Returns a distributor instance to be used by the cluster.
public getDistributor ( ) : Predis\Cluster\Distributor\DistributorInterface
return Predis\Cluster\Distributor\DistributorInterface

getSlot() public method

Returns a slot for the given command used for clustering distribution or NULL when this is not possible.
public getSlot ( Predis\Command\CommandInterface $command ) : integer
$command Predis\Command\CommandInterface Command instance.
return integer

getSlotByKey() public method

Returns a slot for the given key used for clustering distribution or NULL when this is not possible.
public getSlotByKey ( string $key ) : integer
$key string Key string.
return integer