Search documentation of bb

# BB.Command.Server (bb v0.17.0)

Copy Markdown View Source

GenServer wrapper for command callback modules.

This module manages the lifecycle of user-defined command modules, handling:

- Parameter reference resolution at startup
- Subscription to parameter changes
- Safety state change notifications
- Delegation of GenServer callbacks to user module
- Result extraction and delivery to awaiting callers

Command servers are temporary - they are not restarted on crash.

## Summary

### Types

t()

### Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

## Types

# t()

    @type t() :: %BB.Command.Server{
      awaiting: [GenServer.from()],
      callback_module: module(),
      context: BB.Command.Context.t(),
      execution_id: reference(),
      goal: BB.Command.goal(),
      param_subscriptions: %{required([atom()]) => atom()},
      raw_opts: keyword(),
      resolved_opts: keyword(),
      runtime_pid: pid(),
      timeout_ref: reference() | nil,
      user_state: term()
    }

## Functions

# child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See `Supervisor`.