Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Func ¶
type Func func()
The Func type is an adapter to allow the use of ordinary functions as ShutdownableService.
type ParentService ¶
type ParentService struct {
// contains filtered or unexported fields
}
ParentService aggregates services that are Shutdownable. Those services are registered in parent and shutdown is cascaded to them.
func (*ParentService) Register ¶
func (s *ParentService) Register(child ShutdownableService)
Register is registering dependent service to be shutdown on parent service shutdown.
func (*ParentService) Shutdown ¶
func (s *ParentService) Shutdown() error
Shutdown is called to trigger shutdown of all associated children. It waits for all children.
Child shutdown is considered successful also in cases when context.Cancelled error is returned.
type ShutdownableService ¶
type ShutdownableService interface {
Shutdown() error
}
ShutdownableService represents a service that supports graceful shutdown pattern.
Click to show internal directories.
Click to hide internal directories.