Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GracefulShutdown ¶
func GracefulShutdown(ctx context.Context, timeout time.Duration, ops []NamedOperation) <-chan struct{}
GracefulShutdown waits for a termination syscall, then runs ops in the order given.
Types ¶
type CleanupOperation ¶
CleanupOperation is a clean up function on shutting down
type NamedOperation ¶ added in v1.0.79
type NamedOperation struct {
Name string
Op CleanupOperation
}
NamedOperation is one shutdown step. Order matters, so the caller supplies a slice: these used to run concurrently off a map, which let the gRPC server stop while the services still had work in flight.
Click to show internal directories.
Click to hide internal directories.