# RedixPool
Simple Redis pooling built on [redix](https://github.com/whatyouhide/redix) and [poolboy](https://github.com/devinus/poolboy).
## Installation
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `redix_pool` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[{:redix_pool, "~> 0.1.0"}]
end
```
## Configuration
`RedixPool` currently only supports a few basic configuration options:
```elixir
# myapp/config/config.exs
use Mix.Config
config :redix_pool,
redis_url: "redis://localhost:6379",
pool_size: {:system, "POOL_SIZE"}, # System.get_env("POOL_SIZE") will be executed at runtime
pool_max_overflow: 1
```
## Basic Usage
`RedixPool` supports `command/2` and `pipeline/2` (and their bang variants), which are just like the `Redix` `command/3` and `pipeline/3` functions, except `RedixPool` handles the connection for you.
This means using `command` is as simple as:
```elixir
alias RedixPool, as: Redis
Redis.command(["FLUSHDB"])
#=> {:ok, "OK"}
Redis.command(["SET", "foo", "bar"])
#=> {:ok, "OK"}
Redis.command(["GET", "foo"])
#=> {:ok, "bar"}
```
## Testing
Currently, the tests assume you have an instance of Redis running locally at `localhost:6379`.
On OSX, Redis can be installed easily with `brew`:
```bash
brew install redis
```
Once you have Redis running, simply run `mix test`.
Documentation can be generated with [ExDoc](https://github.com/elixir-lang/ex_doc)
and published on [HexDocs](https://hexdocs.pm). Once published, the docs can
be found at [https://hexdocs.pm/redix_pool](https://hexdocs.pm/redix_pool).