To make sure that these functions can also be called from functions
other than command callbacks, the flag IN_CALLBACK is introduced that
holds whether the context is currently executing a callback. If so,
redisAsyncFree() and redisAsyncDisconnect() should delegate their task
to the reply processor to avoid segfaults.
When no reply object functions are defined, the reply type integer is
returned from redisGetReply(). This sets the *reply argument to the
consumed reply, where 0 means that it was not possible to consume a full
reply. With REDIS_REPLY_ERROR having the same value, there is no way to
tell the difference between an error reply and not consuming a reply.
When there is an I/O error, errno should be used to find out what is
wrong. In other cases, errno cannot be used. So, use an explicit type in
Hiredis to define the different error scenarios that can occur.
This allows users of the API to format a command without the need to
have all the sds functions included, only for free'ing the returned
wire-level command.
This removes the need to wrap an event_base pointer in the redisContext
struct and allows multiple connections to be used in a single
event_base. Also, use the *privdata argument to the provided callbacks
to curry the redisEvent struct around.
Rather, use the return value REDIS_OK and REDIS_ERR to designate if
calling a function has a successful outcome. When there was an error in
performing the call the error field will be set inside the reader or the
context.
The context supports both blocking and non-blocking connections. All
read and write events are not handled by hiredis, but hiredis exposes an
API for buffered reading/writing to Redis.
Allows libraries to wrap the reply parsing code and build the reply in a
streaming fashion. Reply objects can immediately be initialized to the
required type without having to convert an intermediary format.