RedisCluster.Pool (redis_cluster v0.8.0)
View SourceRedis Cluster connection supervisor. A "pool" in this context is a set of connections that point to the same Redis node (host and port). A Redis cluster will have a pool of connections for each node in the cluster.
Summary
Functions
Returns a specification to start this module under a supervisor.
Retrieves a connection from the pool based on the host and port. Will return the same connection for the same host and port per process.
Starts a pool of connections for the given node information. The configuration specifies how many connections to start for the given node.
Stops all connections in the pool. This is typically called when the application rediscovers the cluster.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec get_conn( RedisCluster.Configuration.t(), host :: binary(), port :: non_neg_integer() ) :: pid()
Retrieves a connection from the pool based on the host and port. Will return the same connection for the same host and port per process.
@spec start_pool(RedisCluster.Configuration.t(), RedisCluster.Cluster.NodeInfo.t()) :: :ok
Starts a pool of connections for the given node information. The configuration specifies how many connections to start for the given node.
@spec stop_pool(RedisCluster.Configuration.t()) :: :ok
Stops all connections in the pool. This is typically called when the application rediscovers the cluster.