Raxol.Core.Behaviours.BaseManager behaviour (Raxol v2.0.1)

View Source

Base behavior for manager GenServers to reduce code duplication. Provides common patterns for state management, lifecycle, and error handling.

Summary

Callbacks

Called to handle manager-specific requests.

Called to handle manager-specific casts.

Called to handle manager-specific info messages.

Called to initialize the manager state. Must return {:ok, state}. For initialization failures, raise an exception to let the supervisor handle restart logic.

Callbacks

handle_manager_call(any, from, any)

(optional)
@callback handle_manager_call(any(), GenServer.from(), any()) ::
  {:reply, any(), any()} | {:noreply, any()} | {:stop, any(), any(), any()}

Called to handle manager-specific requests.

handle_manager_cast(any, any)

(optional)
@callback handle_manager_cast(any(), any()) :: {:noreply, any()} | {:stop, any(), any()}

Called to handle manager-specific casts.

handle_manager_info(any, any)

(optional)
@callback handle_manager_info(any(), any()) :: {:noreply, any()} | {:stop, any(), any()}

Called to handle manager-specific info messages.

init_manager(keyword)

@callback init_manager(keyword()) :: {:ok, any()}

Called to initialize the manager state. Must return {:ok, state}. For initialization failures, raise an exception to let the supervisor handle restart logic.