www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Hunt Redis 1.0.0 released! Powrerful Redis Client Library!

Hunt Redis is a Redis client developed in D language, which is 
very easy to use. API is migrated from Jedis, the most easily 
used Redis client project in Java, and is compatible with Redis 
2.8.x / 3.x / 4.x / 5.x :)

Now after a period of testing officially released version 1.0.0, 
welcome to the experience, below is the sample code.

Features:

- Sorting
- Connection handling
- Commands operating on any kind of values
- Commands operating on string values
- Commands operating on hashes
- Commands operating on lists
- Commands operating on sets
- Commands operating on sorted sets
- Transactions
- Pipelining
- Publish/Subscribe
- Persistence control commands
- Remote server control commands
- Connection pooling
- Sharding (MD5, MurmurHash)
- Key-tags for sharding
- Sharding with pipelining
- Scripting with pipelining
- Redis Cluster




```D
import hunt.redis;

import std.stdio : writeln;

void main()
{
     auto redis = new Redis("localhost");

     redis.set("foo", "bar");

     string value = redis.get("foo");

     writeln(value); // print bar
}
```



```D
import hunt.redis;

import std.stdio;

void main()
{
     auto redisClusterNodes = new HashSet!(HostAndPort)();

     redisClusterNodes.add(new HostAndPort("127.0.0.1", 7379));

     auto rc = new RedisCluster(redisClusterNodes);

     rc.set("foo", "bar");

     string value = rc.get("foo");

     writeln(value); // print bar
}
```

DLang Code:
https://code.dlang.org/packages/hunt-redis

Github Repository:
https://github.com/huntlabs/hunt-redis
Dec 12 2019