Questions tagged [hiredis]

Hiredis is a minimalistic C client library for the Redis database

Hiredis is a minimalistic C client library for the Redis database.

It is minimalistic because it just adds minimal support for the protocol, but at the same time it uses an high level printf-alike API in order to make it much higher level than otherwise suggested by its minimal code base and the lack of explicit bindings for every Redis command.

Apart from supporting sending commands and receiving replies, it comes with a reply parser that is decoupled from the I/O layer. It is a stream parser designed for easy reusability, which can for instance be used in higher level language bindings for efficient reply parsing.

Hiredis only supports the binary-safe Redis protocol, so you can use it with any Redis version >= 1.2.0.

The library comes with multiple APIs. There is the synchronous API, the asynchronous API and the reply parsing API.

Source Code: https://github.com/redis/hiredis

139 questions
11
votes
2 answers

How to use HSCAN command in Redis?

I want to use Redis's HSCAN command in my assignment but I have no idea how it works. Redis's official page (http://redis.io/commands/hscan) for this command gives me blank page. I am getting continuous input data and saving them instantaneously in…
user2418755
  • 111
  • 1
  • 1
  • 3
10
votes
6 answers

2 Node Redis HA

I have two nodes which I want to run as servers in active-active mode and also have HA capability i.e if one is down, the other one should start receiving all the requests but while both are up, both should be taking all the requests. Now since…
BigBrother323
  • 101
  • 1
  • 4
7
votes
2 answers

Redis Transaction rollback

I am new to redis. I have an application in which i have multiple redis commands which makes a transaction. If one of them fails does redis rollback the transaction like relational databases ? Is it users responsibility to rollback the transaction ?
Vishnu
  • 91
  • 1
  • 2
6
votes
1 answer

Redis - ECONNREFUSED. Even though server is running

I already read all the other threads on stackoverflow about the ECONNREFUSED error but still nothing worked. Currently I am working on Ubuntu 12.04.1 LTS For tests I have this really simple code: var redis = require("redis"), client =…
ToniB
  • 93
  • 2
  • 7
6
votes
2 answers

Hiredis timeout with large number of concurrent requests

I'm using a redis integration plugin for Varnish called libvmod-redis. I'm seeing an issue where if I get a large number of concurrent requests, around 350, redis starts timing out and I eventually get a segfault in Varnish. I get these…
Brandon
  • 16,382
  • 12
  • 55
  • 88
6
votes
1 answer

nodejs: error when installing hiredis package

Trying to install hiredis in nodejs and I'm getting this error. I can't find anything useful on Google. Anyone had this issue ? I'm using latest version of nodejs. C:\Users\berthsa\new>npm install hiredis --save npm http GET…
Sam
  • 13,934
  • 26
  • 108
  • 194
5
votes
1 answer

Is there a way of referring to a C constant that was never defined/declared?

I think the answer is no, and I usually don't have trouble going through source code, but I am slightly new to C/C++ and can't find where this constant is declared. I am looking for CMD_REQ_REDIS_MGET in The hiredis-vip client library for Redis. I…
Sidd Singal
  • 559
  • 6
  • 16
5
votes
1 answer

Is it possible to set default ttl for all keys in redis?

I've read redis config document but can't find such option. I've searched and found that "by default, the key will simply live forever". And I want to change this default behavior eagerly. Normally Redis keys are created without an associated time…
oyjh
  • 1,248
  • 1
  • 9
  • 20
5
votes
0 answers

Using Redis with libuv in Windows

I'm trying to compile the example program that comes with hiredis (C++), using libuv as an event library. The Windows-compatible version of Redis uses a library called Win32_Interop. I've run into two problems: Both libuv and Win32_Interop define…
albizgil
  • 103
  • 6
5
votes
1 answer

error in installing hiredis through npm

I am trying to install hiredis through npm and it is giving error as npm install hiredis redis npm http GET https://registry.npmjs.org/redis npm http GET https://registry.npmjs.org/hiredis npm http 304 https://registry.npmjs.org/hiredis …
Mohit
  • 183
  • 1
  • 3
  • 18
4
votes
2 answers

Develop with hiredis on Windows

Trying to use hiredis on Windows, building a normal c++ application to read from and write to redis. The problem is that hiredis does not officially support building on Windows. How can one build an application utilizing hiredis with c++?
Klaus
  • 2,460
  • 1
  • 21
  • 23
4
votes
2 answers

Executing HMSET command with hiredis

I want to put a std::map into redis server with hiredis. Since the API only allows formatted strings to be passed to redisCommand, I'm unable to store the map via a single command. I've tried using pipelines, but that is…
Klaus
  • 2,460
  • 1
  • 21
  • 23
4
votes
2 answers

npm install redis problems

Having problems running npm install redis. Got error: npm WARN install Refusing to install redis as a dependency of itself When I tried to install hiredis it would appear to install just fine however, when I tried to run any of the examples they…
PhilMDev
  • 351
  • 3
  • 6
3
votes
1 answer

reading arguments of $-method functions

I use redux::hiredis over ssh port-forwarding for some projects, and my network link occasionally glitches and the connection object fails (for known reasons). redux provides R$reconnect() for this, I'm trying to find a way to automate reconnecting…
r2evans
  • 141,215
  • 6
  • 77
  • 149
3
votes
1 answer

efficient handling of creating a template for SET command of redis (hiredis)

I am new to redis. I want to write a simple library (for testing) that is on top level of the hiredis. for example to implement SET command I wrote the code…
Jafar Gh
  • 137
  • 2
  • 12
1
2 3
9 10