evoq_subscription_adapter behaviour (evoq v1.14.1)
View SourceSubscription adapter behavior for evoq
Defines the interface for subscription operations. Subscriptions enable event handlers to receive events as they are appended.
Supports multiple subscription types: - stream: Subscribe to events from a specific stream - event_type: Subscribe to events of a specific type (across all streams) - event_pattern: Subscribe using wildcard patterns - event_payload: Subscribe based on event payload content
Summary
Types
-type start_from() :: origin | current | {position, non_neg_integer()}.
Callbacks
-callback ack(StoreId :: atom(), SubscriptionName :: binary(), StreamId :: binary() | undefined, Position :: non_neg_integer()) -> ok | {error, term()}.
-callback get_checkpoint(StoreId :: atom(), SubscriptionName :: binary()) -> {ok, non_neg_integer()} | {error, not_found | term()}.