KubeMQ.CommandReply (kubemq v1.0.1)

Copy Markdown View Source

Reply constructed by a command subscriber to respond to a received command.

Fields

  • request_id (String.t()) — ID of the original command (from KubeMQ.CommandReceive.id).
  • response_to (String.t()) — Reply channel (from KubeMQ.CommandReceive.reply_channel).
  • metadata (String.t() | nil) — Optional response metadata.

  • body (binary() | nil) — Optional response payload.

  • client_id (String.t() | nil) — Responder identifier. Set automatically.

  • executed (boolean()) — Whether the command was executed successfully. Default: false.
  • error (String.t() | nil) — Error message if execution failed.

  • tags (%{String.t() => String.t()}) — Key-value tags. Default: %{}.
  • span (binary() | nil) — Tracing span context (internal).

Usage

reply = KubeMQ.CommandReply.new(
  request_id: command_receive.id,
  response_to: command_receive.reply_channel,
  executed: true
)

Summary

Types

t()

@type t() :: %KubeMQ.CommandReply{
  body: binary() | nil,
  client_id: String.t() | nil,
  error: String.t() | nil,
  executed: boolean(),
  metadata: String.t() | nil,
  request_id: String.t(),
  response_to: String.t(),
  span: binary() | nil,
  tags: %{required(String.t()) => String.t()}
}

Functions

new(opts \\ [])

@spec new(keyword()) :: t()

to_response_map(reply)

@spec to_response_map(t()) :: map()