Raxol.Core.Runtime.Plugins.PluginCommandHandler.Behaviour behaviour (Raxol v0.5.0)
View SourceDefines the behaviour for plugin command handling.
This behaviour is responsible for:
- Processing command requests
- Executing commands through plugins
- Managing command results and error handling
- Handling command timeouts and errors
Summary
Callbacks
Handles a command request by delegating to the appropriate plugin. Returns an updated state and any necessary side effects.
Handles command errors.
Handles command results.
Handles command timeouts.
Updates the command handler state.
Callbacks
@callback handle_command( command_atom :: atom(), namespace :: atom(), data :: list(), dispatcher_pid :: pid(), state :: map() ) :: {:ok, map()} | {:error, any()}
Handles a command request by delegating to the appropriate plugin. Returns an updated state and any necessary side effects.
@callback handle_command_error( command_atom :: atom(), error :: any(), dispatcher_pid :: pid(), state :: map() ) :: {:ok, map()} | {:error, any()}
Handles command errors.
@callback handle_command_result( command_atom :: atom(), result :: any(), dispatcher_pid :: pid(), state :: map() ) :: {:ok, map()} | {:error, any()}
Handles command results.
@callback handle_command_timeout( command_atom :: atom(), dispatcher_pid :: pid(), state :: map() ) :: {:ok, map()} | {:error, any()}
Handles command timeouts.
Updates the command handler state.