valkey/reply
reply-type
(reply-type [r :int] :cstr)
return a string describing the type of a reply.
| r | reply-ptr (ok-val from a valkey/cmd result) |
One of: "string", "integer", "array", "nil", "error", "status", "unknown".
(reply-type r) ; => "string"
Since: VK0
reply-string
(reply-string [r :int] :cstr)
return the string content of a string, status, or error reply.
| r | reply-ptr (ok-val from a valkey/cmd result) |
Reply string as :cstr; valid until reply-free is called. Returns empty string for non-string reply types.
(reply-string r) ; => "OK"
Since: VK0
reply-int
(reply-int [r :int] :int)
return the integer value of an integer reply.
| r | reply-ptr (ok-val from a valkey/cmd result) |
Reply integer as :int.
(reply-int r) ; => 42
Since: VK0
reply-array-len
(reply-array-len [r :int] :int)
return the number of elements in an array reply.
| r | reply-ptr (ok-val from a valkey/cmd result) |
Element count as :int; 0 for non-array replies.
(reply-array-len r) ; => 3
Since: VK0
reply-array-get
(reply-array-get [r :int i :int] :int)
return the i-th sub-reply of an array reply as an :int handle.
| r | reply-ptr (ok-val from a valkey/cmd result) | |
| i | 0-based element index |
Sub-reply pointer as :int; pass to reply-type, reply-string, etc. The sub-reply is owned by the parent reply; do not call reply-free on it.
(reply-string (reply-array-get r 0)) ; => "item0"
Since: VK0
reply-free
(reply-free [r :int] :void)
release a reply object and all its sub-replies.
| r | reply-ptr (ok-val from a valkey/cmd result) |
void
(reply-free r)
Since: VK0