No matching definitions.

valkey/reply

src/valkey/reply.tur
defn

reply-type

(reply-type [r :int] :cstr)

return a string describing the type of a reply.

rreply-ptr (ok-val from a valkey/cmd result)

One of: "string", "integer", "array", "nil", "error", "status", "unknown".

(reply-type r)  ; => "string"

Since: VK0

defn

reply-string

(reply-string [r :int] :cstr)

return the string content of a string, status, or error reply.

rreply-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

defn

reply-int

(reply-int [r :int] :int)

return the integer value of an integer reply.

rreply-ptr (ok-val from a valkey/cmd result)

Reply integer as :int.

(reply-int r)  ; => 42

Since: VK0

defn

reply-array-len

(reply-array-len [r :int] :int)

return the number of elements in an array reply.

rreply-ptr (ok-val from a valkey/cmd result)

Element count as :int; 0 for non-array replies.

(reply-array-len r)  ; => 3

Since: VK0

defn

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.

rreply-ptr (ok-val from a valkey/cmd result)
i0-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

defn

reply-free

(reply-free [r :int] :void)

release a reply object and all its sub-replies.

rreply-ptr (ok-val from a valkey/cmd result)

void

(reply-free r)

Since: VK0