ClusterCodec

Reads and writes the messages between the nodes of a service as JSON: the cluster channel's ForwardCommand and ForwardReply, and the WaitSignal a node sends to the origin of a wait, reading leniently: unknown fields are ignored at every level, and an unknown status, stage or function kind of a result is read as UNKNOWN (WowJson.readerBuilder), so a node of the minor version before reads a newer one's.

The mapper is Wow's (WowJson): it registers a fixed set of modules, the Kotlin module only, and never discovers others on the class path, since the wire form is the protocol and must not depend on what a host happens to bring; and it keeps every number exact, so a forwarded command's body reaches its owner with 2.50 as 2.50.

Functions

Link copied to clipboard
fun command(model: AggregateModel<*>, wire: CommandWire): Command<*>?

The command wire holds, its body read as model's command type of that name; null when it has none.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

The signals of a request body: one signal (encode) or a batch (encodeSignals).

Link copied to clipboard
Link copied to clipboard

A batch of signals to one node, a JSON array of what encode writes for each. A node that reads only single signals refuses the array as malformed; its sender then falls back to one signal a request.

Link copied to clipboard
fun wire(model: AggregateModel<*>, command: Command<*>): CommandWire

command, a command of model, in its wire form.

fun wire(type: String, command: Command<*>, replyTo: ReplyTo? = null): CommandWire

command, of the command type named type, in its wire form, with the replyTo of a rejection.