Core facilities for communicating with Redis servers using the Redis request/response protocol, Ref. http://redis.io/topics/protocol.
Core facilities for communicating with Redis servers using the Redis request/response protocol, Ref. http://redis.io/topics/protocol.
(-with-replies body-fn as-pipeline?)Implementation detail
Implementation detail
(execute-requests get-replies? as-pipeline?)(execute-requests conn requests get-replies? as-pipeline?)Implementation detail. Sends given/dynamic requests to given/dynamic Redis server and optionally blocks to receive the relevant queued (pipelined) parsed replies.
Implementation detail. Sends given/dynamic requests to given/dynamic Redis server and optionally blocks to receive the relevant queued (pipelined) parsed replies.
(get-parsed-reply in ?parser)Implementation detail
Implementation detail
(get-unparsed-reply in req-opts)Implementation detail. BLOCKS to receive a single reply from Redis server and returns the result as [<type> <reply>]. Redis will reply to commands with different kinds of replies, identified by their first byte, Ref. http://redis.io/topics/protocol:
+ for simple strings -> <string>: for integers -> <long>- for error strings -> <ex-info>$ for bulk strings -> <clj>/<raw-bytes> ; Marked as serialized
-> <bytes>/<raw-bytes> ; Marked as binary
-> <string>/<raw-bytes> ; Unmarked
-> nil* for arrays -> <vector>
-> nilImplementation detail.
BLOCKS to receive a single reply from Redis server and returns the result as
[<type> <reply>]. Redis will reply to commands with different kinds of replies,
identified by their first byte, Ref. http://redis.io/topics/protocol:
* `+` for simple strings -> <string>
* `:` for integers -> <long>
* `-` for error strings -> <ex-info>
* `$` for bulk strings -> <clj>/<raw-bytes> ; Marked as serialized
-> <bytes>/<raw-bytes> ; Marked as binary
-> <string>/<raw-bytes> ; Unmarked
-> nil
* `*` for arrays -> <vector>
-> nil(byte-str x)Coerces arbitrary Clojure val to Redis bytestring
Coerces arbitrary Clojure val to Redis bytestring
(parse f & body)Wraps body so that replies to any wrapped Redis commands will be parsed with
(f reply). Replaces any current parser; removes parser when f is nil.
See also parser-comp.
Wraps body so that replies to any wrapped Redis commands will be parsed with `(f reply)`. Replaces any current parser; removes parser when `f` is nil. See also `parser-comp`.
(parser-comp f g)Composes parsers when f or g are nnil, preserving metadata
Composes parsers when f or g are nnil, preserving metadata
(raw x)Forces byte[] argument to be sent to Redis as raw, unencoded bytes.
Forces byte[] argument to be sent to Redis as raw, unencoded bytes.
Takes values and returns them as part of next reply from Redis server.
Unlike echo, does not actually send any data to Redis.
Takes values and returns them as part of next reply from Redis server. Unlike `echo`, does not actually send any data to Redis.
(return-parsed-replies preplies as-pipeline?)Implementation detail
Implementation detail
(with-context conn & body)Implementation detail
Implementation detail
(with-replies & body)(with-replies :as-pipeline & body)Alpha - subject to change. Evaluates body, immediately returning the server's response to any contained Redis commands (i.e. before enclosing context ends).
As an implementation detail, stashes and then returns any replies already
queued with Redis server: i.e. should be compatible with pipelining.
Note on parsers: if you're writing a Redis command (e.g. a fn that is
intended to execute w/in an implicit connection context) and you're using
with-replies as an implementation detail (i.e. you're interpreting
replies internally), you probably want (parse nil (with-replies ...)) to
keep external parsers from leaking into your internal logic.
Alpha - subject to change. Evaluates body, immediately returning the server's response to any contained Redis commands (i.e. before enclosing context ends). As an implementation detail, stashes and then `return`s any replies already queued with Redis server: i.e. should be compatible with pipelining. Note on parsers: if you're writing a Redis command (e.g. a fn that is intended to execute w/in an implicit connection context) and you're using `with-replies` as an implementation detail (i.e. you're interpreting replies internally), you probably want `(parse nil (with-replies ...))` to keep external parsers from leaking into your internal logic.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |