Skip to main content

watch_fidl_service

Function watch_fidl_service 

Source
pub fn watch_fidl_service<S, F>(
    kernel: &Kernel,
    marker: S,
    task_name: &'static str,
    on_instance: F,
)
where S: ServiceMarker + Send + 'static, F: AsyncFn(&Weak<Kernel>, S::Proxy) + Send + 'static,
Expand description

Opens marker in the process’s /svc namespace and watches for service instances on the kernel’s main async executor.

Discovery runs as a non-blocking task scheduled via KernelThreads::spawn_future rather than on a dedicated blocking kernel thread. on_instance is invoked concurrently for each discovered instance and receives a Weak<Kernel> so callers can perform any asynchronous initialization on the instance before upgrading to a strong Kernel reference.