Documentation
¶
Index ¶
- type Shutdown
- func (s *Shutdown) BeginShutdown()
- func (s *Shutdown) Context() context.Context
- func (s *Shutdown) Done() <-chan struct{}
- func (s *Shutdown) Initiate(source core.CancellationSource, timeout time.Duration)
- func (s *Shutdown) IsShuttingDown() bool
- func (s *Shutdown) Reason() core.CancellationSource
- func (s *Shutdown) RegisterHook(h ShutdownHook)
- type ShutdownHook
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Shutdown ¶
type Shutdown struct {
// contains filtered or unexported fields
}
func NewShutdown ¶
func NewShutdown() *Shutdown
func (*Shutdown) BeginShutdown ¶
func (s *Shutdown) BeginShutdown()
BeginShutdown implements core.ShutdownCoordinator
func (*Shutdown) Done ¶
func (s *Shutdown) Done() <-chan struct{}
Done implements core.ShutdownCoordinator
func (*Shutdown) Initiate ¶
func (s *Shutdown) Initiate( source core.CancellationSource, timeout time.Duration, )
func (*Shutdown) IsShuttingDown ¶
IsShuttingDown reports whether shutdown has started.
func (*Shutdown) Reason ¶
func (s *Shutdown) Reason() core.CancellationSource
Reason returns the shutdown reason. If shutdown has not started, SourceUnknown is returned.
func (*Shutdown) RegisterHook ¶
func (s *Shutdown) RegisterHook(h ShutdownHook)
RegisterHook registers a shutdown hook.
Panics if hook is nil. Registration order defines shutdown order (LIFO).
type ShutdownHook ¶
Click to show internal directories.
Click to hide internal directories.