Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 
 
 

README.md

Vert.x SSDB Client

===================

SSDB - A fast NoSQL database, an alternative to Redis http://ssdb.io https://github.com/ideawu/ssdb

基本用法

SSDBOptions options = new SSDBOptions("127.0.0.1", 8888);
SSDBClient client = SSDBClient.create(vertx, options);
client.get("a", ev -> {
    if (ev.failed()) {
        System.out.println(ev.cause());
        return;
    }
    System.out.println(ev.result());
});
client.setAutoClose(false) // 关闭自动关闭连接
      .dbsize(ev -> {
      })
      .set("a", ev -> {
      })
      .get("a", ev -> client.close(F.noneHandle()));
client.beginBatch()
      .set("a", "a", F.noneHandle())
      .get("a", F.noneHandle())
      .setx("k", "k", 10, F.noneHandle())
      .scan(10, F.noneHandle())
      .setbit("b", 0, 0, F.noneHandle())
      .getbit("b", 0, F.noneHandle())
      .del("a", F.noneHandle())
      .exists("a", F.noneHandle())
      .expire("a", 10, F.noneHandle())
      .hclear("k", F.noneHandle())
      .endBatch(F.noneHandle());
SSDBPool pool = new SSDBPool(vertx, options);
pool.getClient(event -> {
    SSDBClient client = event.result();
    client.dbsize(ev -> {
        System.out.println(ev.result());
    });
});
pool.getClient(event -> {
    SSDBClient client = event.result();
    client.setAutoClose(false) // 关闭自动返回连接池
          .beginBatch()
          .dbsize(ev -> {
              System.out.println(ev.result());
          })
          .set("a", "a", F.noneHandle())
          .endBatch(ev -> client.close(F.noneHandle()));
});

About

Vert.x ssdb client, async NoSQL driver

Resources

License

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.