Event message for the KubeMQ Pub/Sub pattern.
Events are fire-and-forget messages delivered to all active subscribers on a channel.
The store field must remain false for non-persistent events (use KubeMQ.EventStore
for persistent events).
Fields
id(String.t() | nil) — Unique event identifier. Auto-generated by the server if nil.channel(String.t()) — Target channel name. Required for sending.metadata(String.t() | nil) — Optional metadata string.body(binary() | nil) — Message payload.client_id(String.t() | nil) — Sender identifier. Set automatically byKubeMQ.Client.tags(%{String.t() => String.t()}) — Key-value tags for filtering. Default:%{}.store(boolean()) — Alwaysfalse. UseKubeMQ.EventStorefor persistent events.
Usage
event = KubeMQ.Event.new(channel: "notifications", body: "hello")
:ok = KubeMQ.Client.send_event(client, event)
Summary
Functions
Create a new Event struct from keyword options.
Types
Functions
Create a new Event struct from keyword options.
Options
:id— Event ID string (auto-generated if nil):channel— Target channel name (required for sending):metadata— Metadata string:body— Message body (binary):client_id— Client identifier (set automatically byKubeMQ.Client):tags— Key-value tags map (default:%{})
Examples
iex> event = KubeMQ.Event.new(channel: "notifications", body: "hello")
iex> event.channel
"notifications"
iex> event.body
"hello"
iex> event.store
false