pub fn watch_for_exit(&mut self, component: WeakComponentInstance) {
        if let Some(controller) = &self.controller {
            let epitaph_fut = controller.wait_for_epitaph();
            let (abort_client, abort_server) = AbortHandle::new_pair();
            let watcher = Abortable::new(
                async move {
                    epitaph_fut.await;
                    if let Ok(component) = component.upgrade() {
                        let _ = ActionSet::register(component, StopAction::new()).await;
                    }
                },
                abort_server,
            );
            fasync::Task::spawn(watcher.unwrap_or_else(|_| ())).detach();
            self.exit_listener = Some(abort_client);
        }
    }
/// If the Runtime has a controller this creates a background context which
/// watches for the controller's channel to close. If the channel closes,
/// the background context attempts to use the WeakComponentInstance to stop the
/// component.
If the Runtime has a controller this creates a background context which
watches for the controller's channel to close. If the channel closes,
the background context attempts to use the WeakComponentInstance to stop the
component.
If the Runtime has a controller this creates a background context which watches for the controller ' s channel to close . If the channel closes the background context attempts to use the WeakComponentInstance to stop the component .
pub fn watch_for_exit(&mut self, component: WeakComponentInstance) {
        if let Some(controller) = &self.controller {
            let epitaph_fut = controller.wait_for_epitaph();
            let (abort_client, abort_server) = AbortHandle::new_pair();
            let watcher = Abortable::new(
                async move {
                    epitaph_fut.await;
                    if let Ok(component) = component.upgrade() {
                        let _ = ActionSet::register(component, StopAction::new()).await;
                    }
                },
                abort_server,
            );
            fasync::Task::spawn(watcher.unwrap_or_else(|_| ())).detach();
            self.exit_listener = Some(abort_client);
        }
    }
pub fn watch_for_exit ( & mut self , component : WeakComponentInstance ) { if let Some ( controller ) = & self . controller { let epitaph_fut = controller . wait_for_epitaph ( ) ; let ( abort_client , abort_server ) = AbortHandle :: new_pair ( ) ; let watcher = Abortable :: new ( async move { epitaph_fut . await ; if let Ok ( component ) = component . upgrade ( ) { let _ = ActionSet :: register ( component , StopAction :: new ( ) ) . await ; } } , abort_server , ) ; fasync :: Task :: spawn ( watcher . unwrap_or_else ( | _ | ( ) ) ) . detach ( ) ; self . exit_listener = Some ( abort_client ) ; } }
If the Runtime has a controller this creates a background context which
watches for the controller's channel to close.
If the Runtime has a controller this creates a background context which watches for the controller ' s channel to close .
&mut self
component
WeakComponentInstance
&mut self
component
WeakComponentInstance