esdb_channel_server (reckon_gater v1.3.0)

View Source

Generic channel server for reckon-gater

Implements the common server logic for all channels. Delegates channel-specific behavior to the callback module.

Features: - Topic-based pub/sub using pg groups - Rate limiting (configurable per channel) - HMAC signature verification (for critical channels) - Telemetry integration

Summary

Functions

get_subscribers(Channel, Topic)

-spec get_subscribers(atom(), binary()) -> [pid()].

handle_call(Request, From, State)

handle_cast(Msg, State)

handle_info(Message, State)

init(_)

publish(Channel, Topic, Message)

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

publish(Channel, Topic, Message, CapabilityToken)

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

Publish with capability token for authorization

start_link(Module, Opts)

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

subscribe(Channel, Topic, Pid)

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

subscribe(Channel, Topic, Pid, CapabilityToken)

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

Subscribe with capability token for authorization

terminate(Reason, State)

unsubscribe(Channel, Topic, Pid)

-spec unsubscribe(atom(), binary(), pid()) -> ok.