Liking cljdoc? Tell your friends :D

taoensso.carmine.protocol

Facilities for actually communicating with Redis server using its request/response protocol. Originally adapted from Accession. Ref. http://redis.io/topics/protocol

Facilities for actually communicating with Redis server using its
request/response protocol. Originally adapted from Accession.
Ref. http://redis.io/topics/protocol
raw docstring

*context*clj


*nested-stash-consumed?_*clj


*nested-stashed-reqs*clj


*parser*clj


bs-$clj


bs-*clj


bs-binclj


bs-cljclj


bs-crlfclj


execute-requestsclj

(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.
raw docstring

get-parsed-replyclj

(get-parsed-reply in ?parser)

Implementation detail.

Implementation detail.
raw docstring

get-unparsed-replyclj

(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> -> nil
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>
                           -> nil
raw docstring

IRedisArgcljprotocol

coerce-bsclj

(coerce-bs x)

Coerces arbitrary Clojure value to RESP arg, by type.

Coerces arbitrary Clojure value to RESP arg, by type.

no-context-exclj


parsecljmacro

(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`.
raw docstring

parse-nippycljmacro

(parse-nippy thaw-opts & body)

parse-rawcljmacro

(parse-raw & body)

parser-compclj

(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 docstring

pull-requestsclj

(pull-requests req-queue)

Implementation detail.

Implementation detail.
raw docstring

rawclj

(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.
raw docstring

returnclj

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.
raw docstring

return-parsed-repliesclj

(return-parsed-replies preplies as-pipeline?)

Implementation detail.

Implementation detail.
raw docstring

suppressed-reply-kwclj


with-contextcljmacro

(with-context conn & body)

Implementation detail.

Implementation detail.
raw docstring

with-repliescljmacro

(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.
raw docstring

with-replies*clj

(with-replies* body-fn as-pipeline?)

Implementation detail.

Implementation detail.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close