reckon_db_gateway_worker (reckon_db v1.6.0)

View Source

Gateway worker for reckon-db

This worker process acts as the gateway endpoint for a store. It registers with reckon-gater and handles incoming requests routed through the gateway API.

Multiple gateway workers can run per store for load balancing. Each worker registers independently with the gater's Ra-based worker registry.

The message format matches the ExESDB.GatewayWorker from the original Elixir implementation.

Summary

Functions

Start a gateway worker for a store Workers are not locally registered to allow multiple per store. They register with reckon-gater for discovery and load balancing.

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 | by_stream | by_event_type |
          by_event_pattern | by_event_payload | by_tags.

Functions

handle_call(Request, From, State)

handle_cast(Msg, State)

handle_info(Info, State)

start_link(Config)

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

Start a gateway worker for a store Workers are not locally registered to allow multiple per store. They register with reckon-gater for discovery and load balancing.

terminate(Reason, State)