Bier.Events.Listener (bier v0.1.0)

Copy Markdown View Source

Per-instance LISTEN connection for the realtime events endpoint.

Subscribes to every channel in events_channels on one dedicated Postgrex.Notifications connection and fans each notification out to SSE subscribers via Bier.Events.Registry.broadcast/3.

Connection ownership mirrors Bier.SchemaCacheListener: the connection is started with auto_reconnect: false under trap_exit, and on loss the listener stays alive and retries with exponential backoff, so a database outage never crash-loops the instance's supervisor. Delivery is fire-and-forget by contract — notifications sent while disconnected are lost and no catch-up is attempted (unlike the schema-cache listener, there is nothing to reload).

Summary

Functions

Returns a specification to start this module under a supervisor.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(conf)