Skip to main content

Module command

Module command 

Source
Expand description

§Command / Reply – Request-Style Commands and Responses (spec section 15)

Commands implement RPC semantics: a client sends a Command (carrying a correlation_id), the server processes it and returns a Reply (carrying the same correlation_id).

§Flow

Client                         Server
  |                               |
  |-- Command { corr_id=42 } --->|
  |                               |  (process command)
  |<-- Reply { corr_id=42 } -----|
  |                               |

Supports idempotency (via idempotency_key) and timeout control (via timeout_ms).

Structs§

Command
A request-style command – an RPC request sent to the server or a peer.
Reply
A command response – the reply to a Command.
ReplyError
Structured error information within a Reply.

Enums§

ReplyStatus
Reply status code.

Functions§

decode_command
Deserializes a Command from JSON bytes.
decode_reply
Deserializes a Reply from JSON bytes.
encode_command
Serializes a Command to JSON bytes.
encode_reply
Serializes a Reply to JSON bytes.