View Source migraterl_listener (migraterl v0.5.0)
Opt-in reactive layer over Postgres LISTEN/NOTIFY.
Holds a single dedicated connection that LISTENs on the migraterl
events channel and fans each notification out to subscribed processes.
Because NOTIFY fires on commit and the emitting run writes the journal
row in the same transaction, the journal is the durable record of truth
and each event is only a hint that something changed.
Subscribers receive {migraterl_event, Channel, Payload}, where
Channel and Payload are binaries.
Summary
Functions
Start a listener with the given epgsql connect config map.
Subscribe the calling process to migration events.
Functions
Start a listener with the given epgsql connect config map.
-spec subscribe(pid()) -> ok.
Subscribe the calling process to migration events.