event_bus v0.9.0 EventBus.Model.Event

Structure and type for Event model

Link to this section Summary

Types

t()

Defines the Event struct

Functions

Dynamic event builder block with auto initialized_at and occurred_at fields

Duration of the event, and simple answer of how long does it take to generate this event

Dynamic event notifier block with auto initialized_at and occurred_at fields

Link to this section Types

Link to this type t()
t() :: %EventBus.Model.Event{data: any, id: String.t | integer, initialized_at: integer, occurred_at: integer, source: String.t, topic: atom, transaction_id: String.t | integer, ttl: integer}

Defines the Event struct.

  • :id - Identifier
  • :transaction_id - Transaction identifier, if event belongs to a transaction
  • :topic - Topic name
  • :data - Context
  • :initialized_at - When the process initialized to generate this event
  • :occurred_at - When it is occurred
  • :source - Who created this event: module, function or service name are good
  • :ttl - Time to live value

Link to this section Functions

Link to this macro build(id, topic, transaction_id \\ nil, ttl \\ nil, source \\ nil, list) (macro)

Dynamic event builder block with auto initialized_at and occurred_at fields

Duration of the event, and simple answer of how long does it take to generate this event

Link to this macro notify(id, topic, transaction_id \\ nil, ttl \\ nil, source \\ nil, list) (macro)

Dynamic event notifier block with auto initialized_at and occurred_at fields