www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Hunt Cache 0.6.0 released, Distributed cache framework for Web

reply zoujiaqing <zoujiaqing gmail.com> writes:
Hunt Cache is a D language cache framework that supports L2cache, 
and now supports Redis, Memcache, Memory, RocksDB. at the back of 
the cache.

This version changes:

     1. Radix based Memory driver
     2. Using Hunt Redis as Redis backend
     3. Support Redis Cluster
     4. Redis allow set DB
     5. Fix some bugs



```
import hunt.cache;
import hunt.logging;

struct User
{
     int id;
     string name;
     int age;
}

void main()
{
     auto cache = CacheFactory.create();

     // set key for cache data
     string key = "userinfo";

     User user;
     user.id = 1;
     user.name = "zoujiaqing";
     user.age = 100;

     // set cache data
     cache.set(key, user, 10);

     // get data and convert to User type
     User u = cache.get!User(key);

     logDebug(u.name);
}
```
Nov 25 2019
parent zoujiaqing <zoujiaqing gmail.com> writes:
On Tuesday, 26 November 2019 at 04:22:49 UTC, zoujiaqing wrote:
 Hunt Cache is a D language cache framework that supports 
 L2cache, and now supports Redis, Memcache, Memory, RocksDB. at 
 the back of the cache.
Code for DLang: https://code.dlang.org/packages/hunt-cache Reposiroty for Github: https://github.com/huntlabs/hunt-cache
Nov 25 2019