Documentation ¶
Overview ¶
Package servicing provides synchronization, error propagation, and Context cancellation for groups of services
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GracefulShutdownFunc ¶
GracefulShutdownFunc function used to close all opened connections gracefully.
type Service ¶
type Service interface { WithShutdownSignal(shutdown <-chan struct{}, done chan<- struct{}) Service Start() error Name() string Addr() string }
Service is an interface used by ServiceGroup.
type ServiceGroup ¶
type ServiceGroup struct {
// contains filtered or unexported fields
}
ServiceGroup manages services start and graceful shutdown synchronize.
func WithGracefulSutDown ¶
func WithGracefulSutDown(gracefulShutdownFuncs ...GracefulShutdownFunc) *ServiceGroup
WithGracefulSutDown returns a new ServiceGroup with GracefulShutdownFunc functions.
func (*ServiceGroup) Close ¶
func (sg *ServiceGroup) Close() (err error)
Close invokes services to termination.
Click to show internal directories.
Click to hide internal directories.