reckon_db_subscription_health (reckon_db v1.6.0)
View SourceSubscription health monitor for reckon-db
Periodic health checks that detect and clean up: - Stale subscriptions: subscriber process is dead - Orphaned emitter pools: pool running without a subscription - Missing emitter pools: subscription exists but no pool on leader
Runs as a child of notification_sup (after leader_sup and emitter_sup). Only performs cleanup when this node is the Ra leader.
Summary
Functions
Run an on-demand health check and return the report
Types
-type store_config() :: #store_config{store_id :: atom(), data_dir :: string(), mode :: single | cluster, timeout :: pos_integer(), writer_pool_size :: pos_integer(), reader_pool_size :: pos_integer(), gateway_pool_size :: pos_integer(), options :: map()}.
-type subscription() :: #subscription{id :: binary(), type :: subscription_type(), selector :: binary() | map(), subscription_name :: binary(), subscriber_pid :: pid() | undefined, created_at :: integer(), pool_size :: pos_integer(), checkpoint :: non_neg_integer() | undefined, options :: map()}.
-type subscription_type() ::
stream | event_type | event_pattern | event_payload | tags | by_stream | by_event_type |
by_event_pattern | by_event_payload | by_tags.
Functions
Run an on-demand health check and return the report
-spec start_link(store_config()) -> {ok, pid()} | {error, term()}.