ifn (with optional meta) or nil
(-with-replies body-fn as-pipeline?)
(execute-requests get-replies? as-pipeline?)
(execute-requests conn requests get-replies? as-pipeline?)
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)
(get-unparsed-reply in req-opts)
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
* `*` for arrays -> <vector>
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`.
(parse-nippy thaw-opts & body)
(parse-raw & body)
(parser-comp f g)
Composes parsers when f or g are nnil, preserving metadata
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.
(return-parsed-replies preplies as-pipeline?)
(with-context conn & body)
(with-replies :as-pipeline & body)
(with-replies & 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 `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.