All Projects → aclisp → hiredispool

aclisp / hiredispool

Licence: Apache-2.0 license
Provides connection pooling and auto-reconnect for hiredis. It is also minimalistic and easy to do customization.

Programming Languages

c
50402 projects - #5 most used programming language
C++
36643 projects - #6 most used programming language
Makefile
30231 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to hiredispool

mruby-hiredis
mruby bindings for https://github.com/redis/hiredis
Stars: ✭ 12 (-73.91%)
Mutual labels:  hiredis
rcppredis
R interface to Redis using the hiredis library
Stars: ✭ 45 (-2.17%)
Mutual labels:  hiredis
go-redis
GNU Octave Redis client (for Matlab too)
Stars: ✭ 23 (-50%)
Mutual labels:  hiredis

hiredispool

This library provides connection pooling and auto-reconnect for hiredis. It is also minimalistic and easy to do customization. The code has been thoroughly tested in a multi-threaded application, and used in production environments for a long time. It is proven to be thread-safe and no memory leak.

Features

  • Connection pooling implemented in pure C
  • Auto-reconnect and retry instantly at the first failure
  • Comprehensive logging for diagnostic
  • No third-party dependency except hiredis
  • Thread safe C++ wrapper with automatic memory management
  • [Advanced] Multiple server endpoints can be provisioned, with automatic load-balancing and fail-over, to support scenarios such as high availablity redis-cluster and redis-proxy middleware.
  • [Experimental] Jedis-like C++ wrapper
  • [Experimental] On-the-fly re-provisioning

Limitations

  • To support auto-reconnect and retry, you must use a wrapper of hiredis synchronous API

How to use

To build it, clone the repo and make. Check out the test_*.cpp for examples.

Compile

git clone <hiredispool_git_url>
cd hiredispool
git submodule update --init
make
# optional
make install

docker-hiredispool

Dockerfile to build the hiredispool library by aclisp.

Use this image as part of a multistage build to get the library into your own containers without having to build it and clean up dependencies afterwards.

FROM alanvieyra333/hiredispool:latest as HIREDISPOOL

FROM alpine:3.9

COPY --from=HIREDISPOOL /usr/local/lib/libhiredis.so.0.13 /usr/local/lib/libhiredis.so
COPY --from=HIREDISPOOL /usr/local/lib/libhiredispool.so.0.1 /usr/local/lib/libhiredispool.so
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].