Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTerminatedNotifier ¶
func NewTerminatedNotifier() chan struct{}
NewTerminatedNotifier creates a channel which can be used to listen to its being closed
Types ¶
type ManagedService ¶
type ManagedService interface { //Start starts a server which waits on close of the interrupt channel and modifies the wg Start(interrupt chan struct{}, wg *sync.WaitGroup) //GetTerminationNotifier returns a channel which will be closed on termination of the service GetTerminationNotifier() chan struct{} //GetInterrupt returns a interrupt channel set during construction GetInterrupt() chan struct{} }
ManagedService is a service which can be lifecycle managed
func NewManagedService ¶
func NewManagedService(log logr.Logger, service Service, terminated chan struct{}, interrupt chan struct{}) ManagedService
NewManagedService creates a managed service with an optional interrupt channel
type ManagedServiceGroup ¶
type ManagedServiceGroup interface { //Start starts all registered services Start() //GetTerminationNotfier returns a channel which will be closed on termination of all services GetTerminationNotfier() chan struct{} //Wait blocks until all services are terminated Wait() }
ManagedServiceGroup defines a ManagedServiceGroup
func NewManagedServiceGroup ¶
func NewManagedServiceGroup(interrupt chan struct{}, terminated chan struct{}, services ...ManagedService) ManagedServiceGroup
NewManagedServiceGroup creates a new service group
Click to show internal directories.
Click to hide internal directories.