Package mannersagain combines manners and goagain to provide graceful hot restarting of net/http servers.

To use it, just replace your call to http.ListenAndServe with a call to mannersagain.ListenAndServe. When you send SIGUSR2 to the process, it will pass the listener to a new process and exit gracefully. When you send SIGQUIT to the process it will exit gracefully.

mannersagain supports both of the Single and Double strategies that goagain provides, set goagain.Strategy before calling ListenAndServe to change the default.


套餐礼遇组合了礼仪 goagain 提供优雅的热门 重新启动 net / http 服务器。

要使用它,只需将呼叫替换为 http.ListenAndServe ,并调用 mannersagain.ListenAndServe 。当您将SIGUSR2发送到该过程时,它会 将侦听器传递给新进程并正常退出。发送SIGQUIT时 该过程将正常退出。

mannersagain支持goGain的 Single Double 策略。 提供,在调用 ListenAndServe 之前设置 goagain.Strategy 来更改 默认。