Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ShutdownFunc ¶
type ShutdownFunc func()
type Shutdowner ¶
type Shutdowner struct {
// contains filtered or unexported fields
}
Simple struct, use like a sync.Mutex
var s goshutdowner.Shutdowner s.Add(func() { log.Println("Shutting down") })
func (*Shutdowner) Add ¶
func (s *Shutdowner) Add(f ShutdownFunc)
Add a func, that should be called with s.Shutdown() or when receiving a shutdown signal
func (*Shutdowner) ShutdownAndWait ¶
func (s *Shutdowner) ShutdownAndWait()
Shutdown and wait till shutdown finished. Shorthand for:
s.Shutdown() s.Wait()
Click to show internal directories.
Click to hide internal directories.