ExWapp.Event (ExWapp v0.1.2)

Copy Markdown View Source

Runtime-neutral events emitted by the high-level client API.

Applications can route these through PubSub, process messages, webhooks, logs, tests, or any other subscription mechanism by implementing ExWapp.Events.

Summary

Functions

Creates an event with the current UTC timestamp.

Types

t()

@type t() :: %ExWapp.Event{
  at: DateTime.t(),
  metadata: map(),
  payload: term(),
  session_id: term() | nil,
  type: type()
}

type()

@type type() ::
  :qr
  | :status
  | :message_sent
  | :message_received
  | :disconnected
  | :error
  | atom()

Functions

new(type, payload, opts \\ [])

@spec new(type(), term(), keyword()) :: t()

Creates an event with the current UTC timestamp.