View Source RedisPool (redis_pool_xyz v0.1.0)
A module that provides a Redis connection pool using NimblePool.
Example
iex> opts = [url: "redis://:123456@localhost:6379", pool_size: 10, name: :my_pool] iex> RedisPool.start_link(opts) iex> RedisPool.command(:my_pool, ["SET", "foo", "bar"])
iex> RedisPool.command(:my_pool, ["GET", "foo"])
Summary
Types
@type pool_opts_t() :: keyword({:name, atom()} | {:pool_size, non_neg_integer()} | {:url, binary()})
Functions
delegate to Redix.command/2
Examples
iex> RedisPool.command(pool, ["SET", "foo", "bar"])
{:ok, "OK"}
@spec pipeline(pid() | atom(), [Typespecs.command_t()], keyword()) :: {:ok, term()} | {:error, term()}
delegate to Redix.pipeline/2
Examples
iex> RedisPool.pipeline(pool, [["SET", "foo", "bar"], ["SET", "bar", "foo"]])
{:ok, ["OK", "OK"]]}
@spec start_link(pool_opts_t()) :: GenServer.on_start()
start redis with nimble pool
Examples
iex> opts = [url: "redis://:123456@localhost:6379", pool_size: 10, name: :my_pool]
iex> RedisPool.start_link(opts)