pub struct ControlHandler { /* private fields */ }Expand description
Real channel-0 control handler for subc itself.
Implementations§
Source§impl ControlHandler
impl ControlHandler
Sourcepub fn with_route_bind_relay_timeout(self, timeout: Duration) -> Self
pub fn with_route_bind_relay_timeout(self, timeout: Duration) -> Self
Override the route.bind relay timeout. Used by tests that assert the timeout path so they don’t block on the production-safe default.
Sourcepub fn with_route_bind_relay_timeouts(
self,
timeouts: impl IntoIterator<Item = (String, Duration)>,
) -> Self
pub fn with_route_bind_relay_timeouts( self, timeouts: impl IntoIterator<Item = (String, Duration)>, ) -> Self
Install per-module route.bind relay budget overrides. A module id
listed here wins over the daemon-wide default set via
with_route_bind_relay_timeout. Values are pre-resolved at parse time
from subc.jsonc (per-module > daemon-wide > absent), so callers pass
the same Duration the bind path will use.
Sourcepub fn route_bind_relay_timeout_for(&self, module_id: &str) -> Duration
pub fn route_bind_relay_timeout_for(&self, module_id: &str) -> Duration
Resolve the route.bind relay budget for a specific target module id.
Per-module overrides win; the daemon-wide value (set via
with_route_bind_relay_timeout or the built-in default) is the
fallback. Exposed so config-aware callers (bootstrap, tests) can audit
the same resolution handle_route_open will use.
Sourcepub fn with_route_bind_breaker(self, threshold: u32, cooldown: Duration) -> Self
pub fn with_route_bind_breaker(self, threshold: u32, cooldown: Duration) -> Self
Override the per-module bind-relay breaker policy.
Used by tests, which cannot spend three production budgets opening a
breaker or twenty seconds waiting for its cooldown. The production
values are DEFAULT_ROUTE_BIND_BREAKER_THRESHOLD and
DEFAULT_ROUTE_BIND_BREAKER_COOLDOWN, whose doc comments carry the
reasoning for the numbers.
Source§impl ControlHandler
impl ControlHandler
Sourcepub fn with_activity_ledger(self, run_dir: &Path, incarnation: String) -> Self
pub fn with_activity_ledger(self, run_dir: &Path, incarnation: String) -> Self
Open the ledger on its own writer thread; an unavailable sink does not prevent the daemon from serving routing or supervisor requests.
Source§impl ControlHandler
impl ControlHandler
pub fn with_config_runtime(self, runtime: Arc<RuntimeOwner>) -> Self
pub fn with_config_review_admission( self, admission: Arc<dyn ReviewAdmission>, ) -> Self
Sourcepub async fn confirm_config_gate_presence(
&self,
ctx: &RouteCtx,
frame: &Frame,
challenge: &ApprovalChallenge,
) -> PresenceDecision
pub async fn confirm_config_gate_presence( &self, ctx: &RouteCtx, frame: &Frame, challenge: &ApprovalChallenge, ) -> PresenceDecision
Execute only the presence part of an engine-selected challenge. The runtime owner still rechecks the inputs and surface before committing.
Source§impl ControlHandler
impl ControlHandler
Sourcepub fn spawn_capability_deadline_loop(self: Arc<Self>)
pub fn spawn_capability_deadline_loop(self: Arc<Self>)
Wake at each candidate’s own deadline so a stalled fresh exec emits its requirement event without depending on an operator polling a status command.
Source§impl ControlHandler
impl ControlHandler
pub fn refresh_capability_requirements(&self)
Source§impl ControlHandler
impl ControlHandler
pub fn with_supervisor_rescan( self, supervisor: Supervisor, config_path: impl Into<PathBuf>, configured_port: Option<u16>, ) -> Self
Source§impl ControlHandler
impl ControlHandler
pub fn new(registry: Arc<Registry>) -> Self
pub fn with_forwarding( registry: Arc<Registry>, forwarding: Arc<ForwardingTable>, ) -> Self
Sourcepub fn with_storage_config(self, storage_config: Option<StorageConfig>) -> Self
pub fn with_storage_config(self, storage_config: Option<StorageConfig>) -> Self
Set the central storage policy: registering modules then receive their resolved storage descriptor in HELLO_ACK.
Sourcepub fn with_machine_id(self, machine_id: Option<MachineId>) -> Self
pub fn with_machine_id(self, machine_id: Option<MachineId>) -> Self
Set the machine id served to every registering module (HELLO_ACK) and on
server.describe.
Sourcepub fn with_admission_facts_config(
self,
carrier_module_id: Option<String>,
targets: Option<Vec<String>>,
) -> Self
pub fn with_admission_facts_config( self, carrier_module_id: Option<String>, targets: Option<Vec<String>>, ) -> Self
Configure the exact reserved module and target ids permitted to relay opaque admission facts. Config-file loading validates this authority; this builder keeps the same policy available to embedded test daemons.
Set the module ids whose scopes may carry agent_id and delegates.
Replaces the scope table with an empty one under the new list, so call it
while building the handler, before any module can sync.
Set the module ids with narrow authority over head and ephemeral flow scopes. Like the full authority list, this replaces an empty table and must be called before any module can sync.
Sourcepub fn with_federated_scope_owner(self, owner: String) -> Self
pub fn with_federated_scope_owner(self, owner: String) -> Self
Set the exclusive federated owner while building the handler, before syncs.
Sourcepub fn with_privileged_operator_prompt(
self,
mode: PrivilegedOperatorPrompt,
) -> Self
pub fn with_privileged_operator_prompt( self, mode: PrivilegedOperatorPrompt, ) -> Self
Set the startup policy before installing the rescan context or serving requests.
pub fn with_process_liveness( self, process_liveness: Arc<dyn ModuleProcessLiveness>, ) -> Self
pub fn with_supervisor(self, supervisor: SupervisorHandle) -> Self
Sourcepub fn with_capability_config(
self,
modules: impl IntoIterator<Item = (String, bool)>,
reserved_capabilities: BTreeMap<String, String>,
) -> Self
pub fn with_capability_config( self, modules: impl IntoIterator<Item = (String, bool)>, reserved_capabilities: BTreeMap<String, String>, ) -> Self
Install the configured module set and its reserved capability bindings. Bindings are configuration-scoped and may point at a provider that has not been installed yet, so this does not require the bound module to exist.
pub fn with_connected_clients(self, connected_clients: ConnectedClients) -> Self
Report why this daemon serves no local endpoint, in server.describe, so
an operator can see a bind failure without reading the daemon log.