Browse Source

better naming

master
Chakib Benziane 4 years ago
parent
commit
9e52dbcd61
  1. 6
      README.md
  2. 2
      manager.go

6
README.md

@ -6,7 +6,7 @@ Go Unit Manager is a simple Goroutine unit manager for GoLang. @@ -6,7 +6,7 @@ Go Unit Manager is a simple Goroutine unit manager for GoLang.
Features:
- Scheduling of multiple goroutines.
- Subscribe to `os.Signal` events.
- Shutdown on `os.Signal` events.
- Gracefull shutdown of units
@ -70,8 +70,8 @@ func main() { @@ -70,8 +70,8 @@ func main() {
// Create a unit manager
manager := gum.NewManager()
// Subscribe to SIGINT
manager.SubscribeTo(os.Interrupt)
// Shutdown all units on SIGINT
manager.ShutdownOn(os.Interrupt)
// NewWorker returns a type implementing WorkUnit interface unit :=
worker := NewWorker()

2
manager.go

@ -78,7 +78,7 @@ func (m *Manager) Start() { @@ -78,7 +78,7 @@ func (m *Manager) Start() {
}
}
func (m *Manager) SubscribeTo(sig os.Signal) {
func (m *Manager) ShutdownOn(sig os.Signal) {
signal.Notify(m.signal, sig)
}

Loading…
Cancel
Save