Raxol. Plugins. EventHandler. Common
(Raxol v2.6.0)
View Source
Common 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( map(), 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.
Updates a plugin instance in the manager.
Updates the manager state with a new plugin state.