Fact.EventPublisher (Fact v0.2.0)

View Source

The central hub for broadcasting events within a Fact database.

Fact.EventPublisher is a GenServer responsible for publishing newly appended event records to subscribers, either to a specific stream or to the global :all stream. Consumers, catch-up subscriptions, and indexers rely on this module to receive live notifications of changes in the database.

Features

  • Subscribing to a specific event stream or all events
  • Publishing newly appended records to the appropriate topics
  • Integrates with Phoenix.PubSub for low-latency event delivery
  • Ensures that each record is broadcasted both to the global stream and its specific event stream, if present

Summary

Types

appended_message()

@type appended_message() :: {:appended, Fact.record()}

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

publish_appended(database_id, record_ids)

start_link(options \\ [])

subscribe(database_id, arg2)