redisd 0.0.1

Redis client library


To use this package, run the following command in your project's root directory:

Manual usage
Put the following dependency into your project's dependences section:

redisd

redis client library for D.

Why this library?

  • Pluggable connection manager - you can use this library with any underlying transport, both sync and async. Currently supported std.socket, vibe sockets. Any other transport can be easily implemented.
  • redis connection url to control connection details. redis, rediss, redis-socket and any other scheme can be plugged in. Authentication, database selection, etc...
  • minimum overhead on handling network traffic.

Code sample:

import redisd;

void main() {
    auto redis = new Client("redis://:secretpassword@localhost/");
    auto v = redis.set("a", 0);
    writefln("response: %s", v);
    v = redis.execCommand("KEYS", "*");
    writefln("response: %s", v);
    v = redis.execCommand("MGET", "a", "*", "a");
    writefln("MGET response: %s", v);
    v = redis.execCommand("SET", "b", "1");
    writefln("SET response: %s", v);
    v = redis.execCommand("INCR", "b");
    writefln("INCR response: %s", v);
    RedisdValue[] commands;
    commands ~= redis.makeCommand("INCR", "b");
    commands ~= redis.makeCommand("SET", "a", "0");
    commands ~= redis.makeCommand("INCR", "a");
    commands ~= redis.makeCommand("DEL", "mylist");
    v = redis.transaction(commands);
    writefln("transaction=%s", v);
    commands.length = 0;
    foreach (i; 0 .. 100) {
        commands ~= redis.makeCommand("RPUSH", "mylist", to!string(i));
    }
    auto vs = redis.pipeline(commands);
    writeln(vs);
    v = redis.execCommand("LRANGE", "mylist", "0", "100");
    writeln(v);
    redis.close();
}

Authors:
  • Igor Khasilev
Dependencies:
nbuff, urld
Versions:
0.0.2 2019-Jul-13
0.0.1 2019-Jul-12
~master 2019-Jul-13
Show all 3 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 20 downloads total

Score:
0.4
Short URL:
redisd.dub.pm