Raxol.Plugins.EventHandler.Common (Raxol v2.0.1)
View SourceCommon utilities and helper functions for event handling across plugins.
Summary
Functions
Generic dispatcher that reduces over plugins and calls a specific handler function.
Extracts plugin state from a plugin struct.
Handles calling a specific callback on a plugin and processing the result.
Logs an error from a plugin.
Logs an unexpected result from a plugin.
Updates a plugin instance in the manager.
Updates the manager state with a new plugin state.
Types
Functions
@spec dispatch_event( Raxol.Plugins.Manager.Core.t(), callback_name(), list(), non_neg_integer(), accumulator(), result_handler_fun() ) :: accumulator() | {:error, term()}
Generic dispatcher that reduces over plugins and calls a specific handler function.
Extracts plugin state from a plugin struct.
@spec handle_plugin_event( plugin(), callback_name(), list(), non_neg_integer(), accumulator(), result_handler_fun() ) :: {:cont, accumulator()} | {:halt, accumulator()}
Handles calling a specific callback on a plugin and processing the result.
@spec log_plugin_error(plugin(), callback_name(), term()) :: :ok
Logs an error from a plugin.
@spec log_unexpected_result(plugin(), callback_name(), term()) :: :ok
Logs an unexpected result from a plugin.
@spec update_manager_plugin(Raxol.Plugins.Manager.Core.t(), plugin(), plugin()) :: Raxol.Plugins.Manager.Core.t()
Updates a plugin instance in the manager.
@spec update_manager_state(Raxol.Plugins.Manager.Core.t(), plugin(), map()) :: Raxol.Plugins.Manager.Core.t()
Updates the manager state with a new plugin state.