pub fn restart_process(
        &mut self,
        pid: &Pid,
        registry: &mut Registry,
        sig: Signal,
        wait_before_restart: Duration,
    ) -> Option<Pid> {
        let cfg = self.kill_and_remove(pid, sig)?;

        // TODO(VER-737): Instead of waiting an arbitrary duration, we should
        // put a mechanism in place that waits for the process to exit.
        thread::sleep(wait_before_restart);
        Some(self.spawn_and_register_child(cfg, registry))
    }
/// Restarts a given process by killing it, then relaunching with the same
/// configuration. Returns `None` if the given pid is not registered within
/// this process_pool; Returns `Some(p)` on a successfull restart, where `p`
/// is the new pid.
///
/// *NOTE*: (VER-737) If the process is not SIGKILLED, it might be orphaned.
Restarts a given process by killing it, then relaunching with the same
configuration.

NOTE*: (VER-737) If the process is not SIGKILLED, it might be orphaned.
Restarts a given process by killing it then relaunching with the same configuration . NOTE * : ( VER - 737 ) If the process is not SIGKILLED it might be orphaned .
pub fn restart_process(
        &mut self,
        pid: &Pid,
        registry: &mut Registry,
        sig: Signal,
        wait_before_restart: Duration,
    ) -> Option<Pid> {
        let cfg = self.kill_and_remove(pid, sig)?;
        // TODO(VER-737): Instead of waiting an arbitrary duration, we should
        // put a mechanism in place that waits for the process to exit.
        thread::sleep(wait_before_restart);
        Some(self.spawn_and_register_child(cfg, registry))
    }
pub fn restart_process ( & mut self , pid : & Pid , registry : & mut Registry , sig : Signal , wait_before_restart : Duration , ) -> Option < Pid > { let cfg = self . kill_and_remove ( pid , sig ) ? ; // TODO(VER-737): Instead of waiting an arbitrary duration, we should // put a mechanism in place that waits for the process to exit. thread :: sleep ( wait_before_restart ) ; Some ( self . spawn_and_register_child ( cfg , registry ) ) }
Restarts a given process by killing it, then relaunching with the same
configuration.
Restarts a given process by killing it then relaunching with the same configuration .
&mut self
pid
&Pid
registry
&mut Registry
sig
Signal
wait_before_restart
Duration
&mut self
pid
&Pid
registry
&mut Registry
sig
Signal
wait_before_restart
Duration