esdb_channel behaviour (erl_esdb_gater v0.6.6)
View SourceChannel behavior for erl-esdb-gater PubSub API SET
Defines the behavior that all channel implementations must follow. Each channel handles a specific type of message (events, metrics, etc.)
Channel priorities: - critical: alerts, security (no rate limit, HMAC required) - high: events, health - normal: metrics, system - low: logging, diagnostics
Summary
Functions
Get all subscribers for a topic
Publish a message to a channel topic
Publish with capability token for authorization
Start a channel
Subscribe to a channel topic
Subscribe with capability token for authorization
Unsubscribe from a channel topic
Types
Functions
-spec get_subscribers(channel_name(), topic()) -> [pid()].
Get all subscribers for a topic
-spec publish(channel_name(), topic(), term()) -> ok | {error, term()}.
Publish a message to a channel topic
-spec publish(channel_name(), topic(), term(), binary()) -> ok | {error, term()}.
Publish with capability token for authorization
Start a channel
-spec subscribe(channel_name(), topic(), pid()) -> ok | {error, term()}.
Subscribe to a channel topic
-spec subscribe(channel_name(), topic(), pid(), binary()) -> ok | {error, term()}.
Subscribe with capability token for authorization
-spec unsubscribe(channel_name(), topic(), pid()) -> ok.
Unsubscribe from a channel topic