@@ -13,34 +13,34 @@ impl ServerManagerConfig {
1313 self
1414 }
1515
16- pub fn set_before_stop_hook < F , Fut > ( & mut self , f : F ) -> & mut Self
16+ pub fn set_stop_hook < F , Fut > ( & mut self , f : F ) -> & mut Self
1717 where
1818 F : Fn ( ) -> Fut + Send + Sync + ' static ,
1919 Fut : Future < Output = ( ) > + Send + ' static ,
2020 {
21- self . before_stop_hook = Arc :: new ( move || Box :: pin ( f ( ) ) ) ;
21+ self . stop_hook = Arc :: new ( move || Box :: pin ( f ( ) ) ) ;
2222 self
2323 }
2424
25- pub fn set_before_start_daemon_hook < F , Fut > ( & mut self , f : F ) -> & mut Self
25+ pub fn set_start_hook < F , Fut > ( & mut self , f : F ) -> & mut Self
2626 where
2727 F : Fn ( ) -> Fut + Send + Sync + ' static ,
2828 Fut : Future < Output = ( ) > + Send + ' static ,
2929 {
30- self . before_start_daemon_hook = Arc :: new ( move || Box :: pin ( f ( ) ) ) ;
30+ self . start_hook = Arc :: new ( move || Box :: pin ( f ( ) ) ) ;
3131 self
3232 }
3333
3434 pub fn get_pid_file ( & self ) -> & str {
3535 & self . pid_file
3636 }
3737
38- pub fn get_before_stop_hook ( & self ) -> & Hook {
39- & self . before_stop_hook
38+ pub fn get_stop_hook ( & self ) -> & Hook {
39+ & self . stop_hook
4040 }
4141
42- pub fn get_before_start_daemon_hook ( & self ) -> & Hook {
43- & self . before_start_daemon_hook
42+ pub fn get_start_hook ( & self ) -> & Hook {
43+ & self . start_hook
4444 }
4545}
4646
@@ -49,8 +49,8 @@ impl Default for ServerManagerConfig {
4949 let empty_hook: Hook = Arc :: new ( || Box :: pin ( async { } ) ) ;
5050 Self {
5151 pid_file : Default :: default ( ) ,
52- before_stop_hook : empty_hook. clone ( ) ,
53- before_start_daemon_hook : empty_hook,
52+ stop_hook : empty_hook. clone ( ) ,
53+ start_hook : empty_hook,
5454 }
5555 }
5656}
0 commit comments