yuilop eredis wrapper for pool and sharding
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



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, {"", 6379, 0, "", 5}},
   {users, {"", 6380, 0, "", 5}}

You can use this configuration with the following code:

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

Thanks for using it.