Summary
Functions
Returns the most recently broadcast LSN, or 0 if none has been broadcast yet.
Returns the ETS table name used to store LSN info for the given stack ID.
Subscribe the calling process to global LSN updates.
Types
@type stack_ref() :: Electric.stack_id() | atom()
Functions
@spec broadcast_last_seen_lsn( stack_ref(), Electric.Postgres.Lsn.t() | non_neg_integer() ) :: :ok
@spec get_last_broadcast_lsn(stack_ref()) :: non_neg_integer()
Returns the most recently broadcast LSN, or 0 if none has been broadcast yet.
@spec get_last_processed_lsn(stack_ref()) :: Electric.Postgres.Lsn.t() | nil
@spec initialize(stack_ref()) :: :ok
@spec initialize_last_processed_lsn(stack_ref(), Electric.Postgres.Lsn.t()) :: :ok
@spec set_last_processed_lsn( stack_ref(), Electric.Postgres.Lsn.t() | non_neg_integer() ) :: :ok
@spec stack_ref(Electric.stack_id()) :: atom()
Returns the ETS table name used to store LSN info for the given stack ID.
Subscribe the calling process to global LSN updates.
On success, if an LSN has already been broadcast, a {:global_last_seen_lsn, lsn}
message is sent to the calling process (self()) before returning. Callers are
expected to handle that message in their handle_info/2 just like subsequent
broadcasts.
@spec unsubscribe_from_global_lsn_updates(stack_ref()) :: :ok