Wire framing and codec for the transactor protocol: each message is a 4-byte big-endian length followed by UTF-8 EDN. Byte arrays (the one EDN gap) travel as #dos/b64 base64 tags; #inst and #uuid use the default EDN readers. The protocol's op table lives here too — the single source the connection loop, handle-op, the client, and docs/wire-protocol.md all read (#26).
Wire framing and codec for the transactor protocol: each message is a 4-byte big-endian length followed by UTF-8 EDN. Byte arrays (the one EDN gap) travel as #dos/b64 base64 tags; #inst and #uuid use the default EDN readers. The protocol's op table lives here too — the single source the connection loop, handle-op, the client, and docs/wire-protocol.md all read (#26).
(error-data-keys-for kind)The ex-data keys an error kind ships over the wire.
The ex-data keys an error kind ships over the wire.
(op-spec op)One op's spec from the table, or nil.
One op's spec from the table, or nil.
(read-msg in)One message from the stream, or nil at EOF — clean or mid-frame (a truncated frame never decodes). A frame that arrived whole but cannot be read as EDN throws ex-info carrying {:frame <raw text>} with the reader error as cause (#32) — the transactor turns that into a :protocol/bad-frame reply and closes the connection.
One message from the stream, or nil at EOF — clean or mid-frame
(a truncated frame never decodes). A frame that arrived whole but
cannot be read as EDN throws ex-info carrying {:frame <raw text>}
with the reader error as cause (#32) — the transactor turns that
into a :protocol/bad-frame reply and closes the connection.(token-ok? expected supplied)The :connect handshake's token gate (#33): true when the transactor requires no token, or when the supplied token matches — compared in constant time so the handshake does not leak the secret by early exit.
The :connect handshake's token gate (#33): true when the transactor requires no token, or when the supplied token matches — compared in constant time so the handshake does not leak the secret by early exit.
(write-msg out msg)Write one message and flush.
Write one message and flush.
(write-op? op)Does this op serialize through the single-writer lock? Keyed off the op table — the connection loop's only write-ordering knowledge.
Does this op serialize through the single-writer lock? Keyed off the op table — the connection loop's only write-ordering knowledge.
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 |