pub fn stop(&mut self, shutdown_spec: ShutdownSpec) -> impl Future<Item = (), Error = Error> {
        self.stop_health_checks();

        let service_group = self.service_group.clone();
        let gs = Arc::clone(&self.gateway_state);

        let f = self.supervisor
                    .lock()
                    .expect("Couldn't lock supervisor")
                    .stop(shutdown_spec)
                    .and_then(move |_| {
                        gs.write()
                          .expect("GatewayState lock is poisoned")
                          .health_check_data
                          .remove(&service_group);
                        Ok(())
                    });

        // eww
        let service_group_2 = self.service_group.clone();
        match self.post_stop() {
            None => future::Either::A(f),
            Some(hook) => {
                future::Either::B(f.and_then(|_| hook.into_future().map(|_exitvalue| ())))
            }
        }.map_err(move |e| {
             outputln!(preamble service_group_2, "Service stop failed: {}", e);
             e
         })
    }
/// Return a future that will shut down a service, performing any
/// necessary cleanup, and run its post-stop hook, if any.
Return a future that will shut down a service, performing any
necessary cleanup, and run its post-stop hook, if any.
Return a future that will shut down a service performing any necessary cleanup and run its post - stop hook if any .
pub fn stop(&mut self, shutdown_spec: ShutdownSpec) -> impl Future<Item = (), Error = Error> {
        self.stop_health_checks();
        let service_group = self.service_group.clone();
        let gs = Arc::clone(&self.gateway_state);
        let f = self.supervisor
                    .lock()
                    .expect("Couldn't lock supervisor")
                    .stop(shutdown_spec)
                    .and_then(move |_| {
                        gs.write()
                          .expect("GatewayState lock is poisoned")
                          .health_check_data
                          .remove(&service_group);
                        Ok(())
                    });
        // eww
        let service_group_2 = self.service_group.clone();
        match self.post_stop() {
            None => future::Either::A(f),
            Some(hook) => {
                future::Either::B(f.and_then(|_| hook.into_future().map(|_exitvalue| ())))
            }
        }.map_err(move |e| {
             outputln!(preamble service_group_2, "Service stop failed: {}", e);
             e
         })
    }
pub fn stop ( & mut self , shutdown_spec : ShutdownSpec ) -> impl Future < Item = ( ) , Error = Error > { self . stop_health_checks ( ) ; let service_group = self . service_group . clone ( ) ; let gs = Arc :: clone ( & self . gateway_state ) ; let f = self . supervisor . lock ( ) . expect ( " " ) . stop ( shutdown_spec ) . and_then ( move | _ | { gs . write ( ) . expect ( " " ) . health_check_data . remove ( & service_group ) ; Ok ( ( ) ) } ) ; // eww let service_group_2 = self . service_group . clone ( ) ; match self . post_stop ( ) { None => future :: Either :: A ( f ) , Some ( hook ) => { future :: Either :: B ( f . and_then ( | _ | hook . into_future ( ) . map ( | _exitvalue | ( ) ) ) ) } } . map_err ( move | e | { outputln ! ( preamble service_group_2 " " e ) ; e } ) }
Return a future that will shut down a service, performing any
necessary cleanup, and run its post-stop hook, if any.
Return a future that will shut down a service performing any necessary cleanup and run its post - stop hook if any .
&mut self
shutdown_spec
ShutdownSpec
&mut self
shutdown_spec
ShutdownSpec