Raxol.Core.Runtime.Plugins.PluginEventFilter.Behaviour behaviour (Raxol v2.0.1)

View Source

Behavior for plugin event filtering.

Summary

Callbacks

Filters an event through the plugin system. Returns {:ok, event} for modified/passed-through events, :halt to stop event propagation, or {:error, reason} on error.

Initializes the event filter for a plugin.

Terminates the event filter for a plugin.

Callbacks

filter_event(event, plugin_state)

@callback filter_event(event :: term(), plugin_state :: term()) ::
  {:ok, term()} | :halt | {:error, term()}

Filters an event through the plugin system. Returns {:ok, event} for modified/passed-through events, :halt to stop event propagation, or {:error, reason} on error.

init_filter(opts)

@callback init_filter(opts :: keyword()) :: {:ok, term()} | {:error, term()}

Initializes the event filter for a plugin.

terminate_filter(state)

@callback terminate_filter(state :: term()) :: :ok

Terminates the event filter for a plugin.