ExESDBGater.Messages.LifecycleMessages (ex_esdb_gater v0.8.0)

Message definitions and helpers for the :ex_esdb_lifecycle PubSub instance.

Handles process lifecycle events, node management, and process state changes.

Common Topics

  • "node_lifecycle" - Node joining/leaving cluster
  • "process_lifecycle" - Process start/stop/crash events
  • "supervision" - Supervisor tree events
  • "cluster_membership" - Cluster membership changes

Node Field Pattern

  • Uses :node for events originating on a specific node
  • Uses :originating_node for cluster membership events to distinguish from affected nodes in the cluster change

Summary

Functions

Broadcast a cluster membership change

Broadcast a node lifecycle event

Broadcast a process lifecycle event

Broadcast a supervision event

Create a ClusterMembership payload with current timestamp

Create a NodeLifecycle payload with current timestamp

Create a ProcessLifecycle payload with current timestamp

Create a SupervisionEvent payload with current timestamp

Validate and extract a secure message

Functions

broadcast_cluster_membership(topic, payload)

Broadcast a cluster membership change

broadcast_node_lifecycle(topic, payload)

Broadcast a node lifecycle event

broadcast_process_lifecycle(topic, payload)

Broadcast a process lifecycle event

broadcast_supervision_event(topic, payload)

Broadcast a supervision event

cluster_membership(event, affected_nodes, active_nodes, opts \\ [])

Create a ClusterMembership payload with current timestamp

node_lifecycle(node, event, cluster_size, opts \\ [])

Create a NodeLifecycle payload with current timestamp

process_lifecycle(pid, module, event, opts \\ [])

Create a ProcessLifecycle payload with current timestamp

secure_broadcast(topic, message)

supervision_event(supervisor, child_spec, event, opts \\ [])

Create a SupervisionEvent payload with current timestamp

validate_secure_message(arg1)

Validate and extract a secure message