LemonCore. EventBridge
(lemon_core v0.1.0)
View Source
Optional bridge for subscribing/unsubscribing external event fanout.
:lemon_router wants to request "subscribe this run_id" for WebSocket/event
delivery, but should not depend on :lemon_control_plane at compile time.
This module performs dynamic dispatch to a configured implementation module. If no implementation is configured, calls are no-ops.
Summary
Functions
Configure the implementation module.
Configure the implementation module with overwrite controls.
Configure the bridge implementation only if no conflicting implementation is set.
Subscribe to events for the given run ID.
Unsubscribe from events for the given run ID.
Types
Functions
Configure the implementation module.
Typically called by LemonControlPlane.Application at startup:
LemonCore.EventBridge.configure(LemonControlPlane.EventBridge)
Configure the implementation module with overwrite controls.
Modes:
:replace- overwrite any existing implementation (legacy behavior):if_unset- set only when unset or already matching
Configure the bridge implementation only if no conflicting implementation is set.
@spec subscribe_run(binary()) :: :ok
Subscribe to events for the given run ID.
Dispatches to the configured implementation module. No-op if unconfigured.
@spec unsubscribe_run(binary()) :: :ok
Unsubscribe from events for the given run ID.
Dispatches to the configured implementation module. No-op if unconfigured.