Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
hiredis
Commits
cdd026ac
Commit
cdd026ac
authored
Nov 03, 2010
by
Pieter Noordhuis
Browse files
Style
parent
f023f9cf
Changes
1
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
cdd026ac
...
@@ -25,7 +25,7 @@ code using hiredis should not be a big pain. The key thing to keep in mind when
...
@@ -25,7 +25,7 @@ code using hiredis should not be a big pain. The key thing to keep in mind when
upgrading is that hiredis >= 0.9.0 uses a
`redisContext*`
to keep state, in contrast to
upgrading is that hiredis >= 0.9.0 uses a
`redisContext*`
to keep state, in contrast to
the stateless 0.0.1 that only has a file descriptor to work with.
the stateless 0.0.1 that only has a file descriptor to work with.
## S
YNCHRONOUS
API
## S
ynchronous
API
To consume the synchronous API, there are only a few function calls that need to be introduced:
To consume the synchronous API, there are only a few function calls that need to be introduced:
...
@@ -86,30 +86,24 @@ The standard replies that `redisCommand` are of the type `redisReply`. The
...
@@ -86,30 +86,24 @@ The standard replies that `redisCommand` are of the type `redisReply`. The
was received:
was received:
*
**`REDIS_REPLY_STATUS`**
:
*
**`REDIS_REPLY_STATUS`**
:
The command replied with a status reply. The status string can be accessed using
`reply->str`
.
The command replied with a status reply. The status string can be accessed using
`reply->str`
.
The length of this string can be accessed using
`reply->len`
.
The length of this string can be accessed using
`reply->len`
.
*
**`REDIS_REPLY_ERROR`**
:
*
**`REDIS_REPLY_ERROR`**
:
The command replied with an error. The error string can be accessed identical to
`REDIS_REPLY_STATUS`
.
The command replied with an error. The error string can be accessed identical to
`REDIS_REPLY_STATUS`
.
*
**`REDIS_REPLY_INTEGER`**
:
*
**`REDIS_REPLY_INTEGER`**
:
The command replied with an integer. The integer value can be accessed using the
The command replied with an integer. The integer value can be accessed using the
`reply->integer`
field of type
`long long`
.
`reply->integer`
field of type
`long long`
.
*
**`REDIS_REPLY_NIL`**
:
*
**`REDIS_REPLY_NIL`**
:
The command replied with a
**nil**
object. There is no data to access.
The command replied with a
**nil**
object. There is no data to access.
*
**`REDIS_REPLY_STRING`**
:
*
**`REDIS_REPLY_STRING`**
:
A bulk (string) reply. The value of the reply can be accessed using
`reply->str`
.
A bulk (string) reply. The value of the reply can be accessed using
`reply->str`
.
The length of this string can be accessed using
`reply->len`
.
The length of this string can be accessed using
`reply->len`
.
*
**`REDIS_REPLY_ARRAY`**
:
*
**`REDIS_REPLY_ARRAY`**
:
A multi bulk reply. The number of elements in the multi bulk reply is stored in
A multi bulk reply. The number of elements in the multi bulk reply is stored in
`reply->elements`
. Every element in the multi bulk reply is a
`redisReply`
object as well
`reply->elements`
. Every element in the multi bulk reply is a
`redisReply`
object as well
and can be accessed via
`reply->elements[..index..]`
.
and can be accessed via
`reply->elements[..index..]`
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment