All Projects → nekipelov → Redisclient

nekipelov / Redisclient

Licence: mit
Boost.asio based Redis-client library.

Projects that are alternatives of or similar to Redisclient

Cpp Bredis
Boost::ASIO low-level redis client (connector)
Stars: ✭ 117 (-59.52%)
Mutual labels:  redis, redis-client, asio
Redisdesktopmanager Mac
Redis Desktop Manager Mac OSX DMG
Stars: ✭ 149 (-48.44%)
Mutual labels:  redis, redis-client
Redisson
Redisson - Redis Java client with features of In-Memory Data Grid. Over 50 Redis based Java objects and services: Set, Multimap, SortedSet, Map, List, Queue, Deque, Semaphore, Lock, AtomicLong, Map Reduce, Publish / Subscribe, Bloom filter, Spring Cache, Tomcat, Scheduler, JCache API, Hibernate, MyBatis, RPC, local cache ...
Stars: ✭ 17,972 (+6118.69%)
Mutual labels:  redis, redis-client
Go Rejson
Golang client for redislabs' ReJSON module with support for multilple redis clients (redigo, go-redis)
Stars: ✭ 164 (-43.25%)
Mutual labels:  redis, redis-client
Redis Client App
A redis client application on mac, windows and linux.
Stars: ✭ 140 (-51.56%)
Mutual labels:  redis, redis-client
Redis
Type-safe Redis client for Golang
Stars: ✭ 13,117 (+4438.75%)
Mutual labels:  redis, redis-client
Redisearch Py
RediSearch python client
Stars: ✭ 152 (-47.4%)
Mutual labels:  redis, redis-client
Kangaroo
SQL client and admin tool for popular databases
Stars: ✭ 127 (-56.06%)
Mutual labels:  redis, redis-client
Node Redis
A high-performance Node.js Redis client.
Stars: ✭ 14,573 (+4942.56%)
Mutual labels:  redis, redis-client
Cachingframework.redis
Distributed caching based on StackExchange.Redis and Redis. Includes support for tagging and is cluster-compatible.
Stars: ✭ 209 (-27.68%)
Mutual labels:  redis, redis-client
Pottery
Redis for humans. 🌎🌍🌏
Stars: ✭ 204 (-29.41%)
Mutual labels:  redis, redis-client
Redis web manager
Manage your Redis instance (see keys, memory used, connected client, etc...)
Stars: ✭ 139 (-51.9%)
Mutual labels:  redis, redis-client
Aioredis Py
asyncio (PEP 3156) Redis support
Stars: ✭ 2,003 (+593.08%)
Mutual labels:  redis, redis-client
Camellia
camellia framework by netease-im. provider: 1) redis-client; 2) redis-proxy(redis-sentinel/redis-cluster); 3) hbase-client; 4) others
Stars: ✭ 146 (-49.48%)
Mutual labels:  redis, redis-client
Csredis
.NET Core or .NET Framework 4.0+ client for Redis and Redis Sentinel (2.8) and Cluster. Includes both synchronous and asynchronous clients.
Stars: ✭ 1,714 (+493.08%)
Mutual labels:  redis, redis-client
Datamining And Social Sentiment Analysis Based On Weibo
基于微博的数据挖掘与社交舆情分析
Stars: ✭ 149 (-48.44%)
Mutual labels:  redis, asio
Redisdesktopmanager Windows
RedisDesktopManager-Windows 安装包和编译教程
Stars: ✭ 268 (-7.27%)
Mutual labels:  redis, redis-client
Redis Game Transaction
在大型游戏中经常使用分布式,分布式中因为游戏逻辑会经常游戏事务,借助redis特性我们可以实现分布式锁和分布式事务。很多redis集群不支持redis的事务特性。 这个框架用来解决分布式服务器下redis集群事务失效的情况下,基于分布式锁完成分布式事务。支持独占锁,共享锁,读写锁,并且支持事务提交失败情况下的回滚操作,让开发者可以有更多时间侧重游戏逻辑.
Stars: ✭ 124 (-57.09%)
Mutual labels:  redis, redis-client
Redli
Redli - A humane alternative to the Redis-cli and TLS
Stars: ✭ 126 (-56.4%)
Mutual labels:  redis, redis-client
Redis3m
A C++ Redis client
Stars: ✭ 173 (-40.14%)
Mutual labels:  redis, redis-client

redisclient

Build master status: Build travis status Build appveyor status

Build develop status: Build travis status Build appveyor status

Current version: 1.0.2.

Boost.asio based Redis-client header-only library. Simple but powerfull.

This version requires С++11 compiler. If you want to use this library with old compiler, use version 0.4: https://github.com/nekipelov/redisclient/tree/v0.4.

Have amalgamated sources. See files in the amalgamated directory.

Get/set example:

#include <string>
#include <vector>
#include <iostream>
#include <boost/asio/io_service.hpp>
#include <boost/asio/ip/address.hpp>
#include <redisclient/redissyncclient.h>

int main(int, char **)
{
    boost::asio::ip::address address = boost::asio::ip::address::from_string("127.0.0.1");
    const unsigned short port = 6379;
    boost::asio::ip::tcp::endpoint endpoint(address, port);

    boost::asio::io_service ioService;
    redisclient::RedisSyncClient redis(ioService);
    boost::system::error_code ec;

    redis.connect(endpoint, ec);

    if(ec)
    {
        std::cerr << "Can't connect to redis: " << ec.message() << std::endl;
        return EXIT_FAILURE;
    }

    redisclient::RedisValue result;

    result = redis.command("SET", {"key", "value"});

    if( result.isError() )
    {
        std::cerr << "SET error: " << result.toString() << "\n";
        return EXIT_FAILURE;
    }

    result = redis.command("GET", {"key"});

    if( result.isOk() )
    {
        std::cout << "GET: " << result.toString() << "\n";
        return EXIT_SUCCESS;
    }
    else
    {
        std::cerr << "GET error: " << result.toString() << "\n";
        return EXIT_FAILURE;
    }
}

Async get/set example:

#include <string>
#include <iostream>
#include <functional>
#include <boost/asio/io_service.hpp>
#include <boost/asio/ip/address.hpp>

#include <redisclient/redisasyncclient.h>

static const std::string redisKey = "unique-redis-key-example";
static const std::string redisValue = "unique-redis-value";

void handleConnected(boost::asio::io_service &ioService, redisclient::RedisAsyncClient &redis,
        boost::system::error_code ec)
{
    if( !ec )
    {
        redis.command("SET", {redisKey, redisValue}, [&](const redisclient::RedisValue &v) {
            std::cerr << "SET: " << v.toString() << std::endl;

            redis.command("GET", {redisKey}, [&](const redisclient::RedisValue &v) {
                std::cerr << "GET: " << v.toString() << std::endl;

                redis.command("DEL", {redisKey}, [&](const redisclient::RedisValue &) {
                    ioService.stop();
                });
            });
        });
    }
    else
    {
        std::cerr << "Can't connect to redis: " << ec.message() << std::endl;
    }
}

int main(int, char **)
{
    boost::asio::ip::address address = boost::asio::ip::address::from_string("127.0.0.1");
    const unsigned short port = 6379;
    boost::asio::ip::tcp::endpoint endpoint(address, port);

    boost::asio::io_service ioService;
    redisclient::RedisAsyncClient redis(ioService);

    redis.connect(endpoint,
            std::bind(&handleConnected, std::ref(ioService), std::ref(redis),
                std::placeholders::_1));

    ioService.run();

    return 0;
}

Also you can build the library like a shared library. Just use -DREDIS_CLIENT_DYNLIB and -DREDIS_CLIENT_BUILD to build redisclient and -DREDIS_CLIENT_DYNLIB to build your project.

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].