Function scope_register_subscriber
Function scope_register_subscriber
Generated from cargo doc --no-deps -p nemo-relay-builtins -p nemo-relay-diagnostics -p nemo-relay-logging -p nemo-relay-plugin-host -p nemo-relay-codecs -p nemo-relay -p nemo-relay-runtime -p nemo-relay-model-pricing -p nemo-relay-resource-metrics -p nemo-relay-observability -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker.
pub fn scope_register_subscriber(
scope_uuid: &Uuid,
name: &str,
callback: Arc<dyn Fn(&Event) + Sync + Send>,
) -> Result<(), FlowError>
Register a scope-local lifecycle event subscriber.
The subscriber remains active only while the target scope is still present on the active scope stack.
Parameters
scope_uuid: UUID of the owning scope.name: Unique subscriber name within the owning scope.callback: Subscriber callback invoked for events emitted under that scope hierarchy.
Returns
A Result that is Ok(()) when the subscriber was registered.
Errors
Returns FlowError::NotFound when the scope does not exist on the active stack and FlowError::AlreadyExists when the scope already owns a subscriber with the same name.
Notes
Scope-local subscribers are removed automatically when the owning scope is popped. Native event-producing APIs enqueue subscriber work and return without waiting for callbacks.