Facilities for actually communicating with Redis server using its request/response protocol. Originally adapted from Accession.
Facilities for actually communicating with Redis server using its request/response protocol. Originally adapted from Accession. Ref: http://redis.io/topics/protocol
(bytestring s)
Redis communicates with clients using a (binary-safe) byte string protocol. This is the equivalent of the byte array representation of a Java String.
Redis communicates with clients using a (binary-safe) byte string protocol. This is the equivalent of the byte array representation of a Java String.
(get-basic-reply! in)
BLOCKS to receive a single reply from Redis server. Applies basic parsing and returns the result.
Redis will reply to commands with different kinds of replies. It is possible to check the kind of reply from the first byte sent by the server:
* With a single line reply the first byte of the reply will be `+`
* With an error message the first byte of the reply will be `-`
* With an integer number the first byte of the reply will be `:`
* With bulk reply the first byte of the reply will be `$`
* With multi-bulk reply the first byte of the reply will be `*`
BLOCKS to receive a single reply from Redis server. Applies basic parsing and returns the result. Redis will reply to commands with different kinds of replies. It is possible to check the kind of reply from the first byte sent by the server: * With a single line reply the first byte of the reply will be `+` * With an error message the first byte of the reply will be `-` * With an integer number the first byte of the reply will be `:` * With bulk reply the first byte of the reply will be `$` * With multi-bulk reply the first byte of the reply will be `*`
(get-replies! reply-count)
BLOCKS to receive one or more (pipelined) replies from Redis server. Applies all parsing and returns the result.
BLOCKS to receive one or more (pipelined) replies from Redis server. Applies all parsing and returns the result.
(send-arg out arg)
Send arbitrary argument along with information about its size: $<size of arg> crlf <arg data> crlf
Binary arguments will be passed through un-munged. String arguments will be turned into byte strings. All other arguments (including numbers!) will be serialized.
Send arbitrary argument along with information about its size: $<size of arg> crlf <arg data> crlf Binary arguments will be passed through un-munged. String arguments will be turned into byte strings. All other arguments (including numbers!) will be serialized.
(send-request! & args)
Sends a command to Redis server using its byte string protocol:
*<no. of args> crlf [ $<size of arg N> crlf <arg data> crlf ...]
Sends a command to Redis server using its byte string protocol: *<no. of args> crlf [ $<size of arg N> crlf <arg data> crlf ...]
(with-context connection & body)
Evaluates body in the context of a thread-bound connection to a Redis server.
Evaluates body in the context of a thread-bound connection to a Redis server.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close