reckon_db_emitter_sup (reckon_db v1.2.6)

View Source

Emitter supervisor for reckon-db

Manages emitter pools for subscriptions. Emitter pools are created dynamically when subscriptions are registered.

Summary

Functions

Start an emitter pool for a subscription

Start the emitter supervisor

Types

store_config/0

-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()}.

subscription/0

-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()}.

subscription_type/0

-type subscription_type() :: stream | event_type | event_pattern | event_payload | tags.

Functions

start_emitter_pool(StoreId, Subscription)

-spec start_emitter_pool(atom(), subscription()) -> {ok, pid()} | {error, term()}.

Start an emitter pool for a subscription

start_link(Store_config)

-spec start_link(store_config()) -> {ok, pid()} | {error, term()}.

Start the emitter supervisor

stop_emitter_pool(StoreId, SubscriptionId)

-spec stop_emitter_pool(atom(), binary()) -> ok | {error, term()}.

Stop an emitter pool