All Projects â†’ uglide â†’ qredisclient

uglide / qredisclient

Licence: other
🔑 Asynchronous Qt-based Redis client with TLS support.

Programming Languages

C++
36643 projects - #6 most used programming language
QMake
1090 projects

qredisclient

API documenation | Examples

Build Status Build status Coverage Status

Asynchronous Qt-based Redis client with TLS support. This client is developed for RedisDesktopManager by Igor Malinovskiy

#include "qredisclient/redisclient.h"

int main(int argc, char *argv[])
{
  // Init qredisclient
  initRedisClient();
  
  // Create connection to local redis
  RedisClient::ConnectionConfig config("127.0.0.1");
  RedisClient::Connection connection(config);
  
  // Run command and wait for result
  connection.commandSync({"PING"}); 
  
  // Run command in async mode
  connection.command({"PING"});
  
  // Run command in db #2
  connection.command({"PING"}, 2); 
  
  // Run async command with callback
  connection.command({"PING"}, [](RedisClient::Response r) { 
    QVariant val = r.getValue(); // get value from response
    // do stuff
  });

  // Use addToPipeline() to enable MULTI+EXEC transactions
  RedisClient::Command cmd;
  cmd.addToPipeline({"SET", "foo", "bar"});
  cmd.addToPipeline({"HSET" "foz", "key", "value"});
  RedisClient::Response response = connection.commandSync(cmd);

  // See more usage examples in the tests/unit_tests folder
}

Supported Qt versions: 5.6-5.9

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].