KubeMQ.QueryReply (kubemq v1.0.1)

Copy Markdown View Source

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

Fields

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

  • body (binary() | nil) — Response payload.

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

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

  • cache_hit (boolean()) — Whether this reply is from cache. Default: false.
  • tags (%{String.t() => String.t()}) — Key-value tags. Default: %{}.
  • span (binary() | nil) — Tracing span context (internal).

Usage

reply = KubeMQ.QueryReply.new(
  request_id: query_receive.id,
  response_to: query_receive.reply_channel,
  executed: true,
  body: result_data
)

Summary

Types

t()

@type t() :: %KubeMQ.QueryReply{
  body: binary() | nil,
  cache_hit: boolean(),
  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()