yuilop eredis wrapper for pool and sharding
Erlang
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
.gitignore
README.md
rebar.config

README.md

yredis

Yuilop eredis wrapper for pool and sharding.

The system can be launched throught yredis:start_link(Config) and Config is defined as:

{Shard, {Server, Port, Database, Password, PoolSize}}

The options mean:

  • Shard: key to use a database pool instead of other. default are used if none matchs.
  • Server: redis server IP or hostname.
  • Port: redis server port number.
  • Database: database number (see Redis SELECT).
  • Password: password to access to redis server (an empty list means none password).
  • PoolSize: connections pool size.

An Example:

Config = [
   {default, {"127.0.0.1", 6379, 0, "", 5}},
   {users, {"127.0.0.1", 6380, 0, "", 5}}
].

You can use this configuration with the following code:

yredis:start(Config).
yredis:command(users, ["GET", "mykey"]). %% query to users
yredis:command(customers, ["GET", "mykey"]). %% query to default

Thanks for using it.