Raxol.Core.Runtime.Plugins.PluginEventFilter.Behaviour behaviour (Raxol v0.5.0)
View SourceDefines the behaviour for plugin event filtering.
This behaviour is responsible for:
- Filtering events through registered plugin filters
- Managing event modifications
- Handling event halting
- Coordinating event propagation
Summary
Callbacks
Applies a single plugin's filter to the event.
Filters an event through registered plugin filters. Returns the filtered event or :halt if the event should be stopped.
Gets a list of enabled plugins in load order.
Handles event filtering errors.
Updates the event filter state.
Callbacks
@callback apply_plugin_filter( plugin_id :: String.t(), event :: Raxol.Core.Runtime.Events.Event.t(), state :: map() ) :: {:ok, Raxol.Core.Runtime.Events.Event.t()} | :halt | {:error, any()}
Applies a single plugin's filter to the event.
@callback filter_event( plugin_manager_state :: map(), event :: Raxol.Core.Runtime.Events.Event.t() ) :: {:ok, Raxol.Core.Runtime.Events.Event.t()} | :halt | {:error, any()}
Filters an event through registered plugin filters. Returns the filtered event or :halt if the event should be stopped.
Gets a list of enabled plugins in load order.
@callback handle_filter_error( plugin_id :: String.t(), error :: any(), event :: Raxol.Core.Runtime.Events.Event.t() ) :: {:ok, Raxol.Core.Runtime.Events.Event.t()} | :halt | {:error, any()}
Handles event filtering errors.
Updates the event filter state.