Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,12 @@ Split.configure do |config|
end
```

Split looks for the Redis host in the environment variable `REDIS_URL` then defaults to `redis://localhost:6379` if not specified by configure block.
Split looks for the Redis host in the environment variable `REDIS_URL` then
defaults to `redis://localhost:6379` if not specified by configure block.

On platforms like Heroku, Split will use the value of `REDIS_PROVIDER` to
determine which env variable key to use when retrieving the host config. This
defaults to `REDIS_URL`.

### Filtering

Expand Down Expand Up @@ -725,18 +730,22 @@ If you're running multiple, separate instances of Split you may want
to namespace the keyspaces so they do not overlap. This is not unlike
the approach taken by many memcached clients.

This feature is provided by the [redis-namespace](https://github.com/defunkt/redis-namespace) library, which
Split uses by default to separate the keys it manages from other keys
in your Redis server.
This feature can be provided by the [redis-namespace](https://github.com/defunkt/redis-namespace)
library. To configure Split to use `Redis::Namespace`, do the following:

Simply use the `Split.redis.namespace` accessor:
1. Add `redis-namespace` to your Gemfile:

```ruby
Split.redis.namespace = "split:blog"
```
```ruby
gem 'redis-namespace'
```

2. Configure `Split.redis` to use a `Redis::Namespace` instance (possible in an
intializer):

We recommend sticking this in your initializer somewhere after Redis
is configured.
```ruby
redis = Redis.new(url: ENV['REDIS_URL']) # or whatever config you want
Split.redis = Redis::Namespace.new(:your_namespace, redis: redis)
```

## Outside of a Web Session

Expand Down