clj-odbp.utils
compose-rid
(compose-rid cluster-id record-position)
Given a cluster-id and a record-position returns a RID in string format.
decode
(decode in spec)
Decode the data stream `in` according to `spec`.
defcommand
macro
(defcommand command-name args request-handler response-handler)
Create a function named `command-name` that accepts the argument specified
in `args`. `request-handler` and `response-handler` must be functions. e.g.:
(defcommand test
[arg-1 arg-2]
request-handler-fn
response-handler-fn)
defconnection
macro
(defconnection command-name args request-handler response-handler service)
Create a function named `command-name` that accepts the argument specified
in `args`. `request-handler` and `response-handler` must be functions.
`service` is a keyword which indicates the service to which the connection
applies. e.g.:
(defconnection test
[arg-1 arg-2]
request-handler-fn
response-handler-fn
:db)
encode
(encode spec message)
Encode `message` applying for each of its fields the function specified in
`spec.`
parse-rid
(parse-rid rid)
Parse a RID in string format and returns a vector with cluster-id and
record-position.
take-upto
(take-upto pred)
(take-upto pred coll)
Returns a lazy sequence of successive items from coll up to and including
the first item for which `(pred item)` returns true.
valid-message?
(valid-message? spec message)
Validate `message` against `spec`.