Raxol.Core.Runtime.Plugins.PluginCommandDispatcher.Behaviour behaviour (Raxol v0.4.0)
View SourceDefines the behaviour for plugin command dispatching.
This behaviour is responsible for:
- Dispatching commands to appropriate plugins
- Managing command execution flow
- Handling command results and errors
- Coordinating command responses
Summary
Callbacks
Dispatches a command to the appropriate plugin. Returns an updated state and any necessary side effects.
Handles command errors from plugins.
Handles command results from plugins.
Handles command timeouts.
Updates the command dispatcher state.
Callbacks
@callback dispatch_command( command_atom :: atom(), namespace :: atom(), data :: list(), dispatcher_pid :: pid(), state :: map() ) :: {:ok, map()} | {:error, any()}
Dispatches a command 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 from plugins.
@callback handle_command_result( command_atom :: atom(), result :: any(), dispatcher_pid :: pid(), state :: map() ) :: {:ok, map()} | {:error, any()}
Handles command results from plugins.
@callback handle_command_timeout( command_atom :: atom(), dispatcher_pid :: pid(), state :: map() ) :: {:ok, map()} | {:error, any()}
Handles command timeouts.
Updates the command dispatcher state.