package
7.1.0+incompatible
Repository: https://github.com/scalingo/go-utils.git
Documentation: pkg.go.dev
# README
Graceful
Default settings
SIGINT and SIGTERM are stopping the application SIGHUB is gracefully restarting it.
Graceful shutdown:
- 1 minute to finish requests
- Then connections cut
Graceful restart:
- Socket file descriptor given to fork/exec child
- 30 minutes to finish requests for old process (can switch to shutdown with a SIGINT/SIGTERM on this process)
Usage
graceful.NewService()
Configuration with options
s := graceful.NewService(
graceful.WithWaitDuration(30 * time.Second),
graceful.WithReloadWaitDuration(time.Hour),
graceful.WithPIDFile("/var/run/service.pid"),
)
err := s.ListenAndServe(ctx, "tcp", ":9000", handler)
# Packages
No description provided by the author
# Functions
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Type aliases
No description provided by the author