Browse Source

better naming

master
Chakib Benziane 2 years ago
parent
commit
9e52dbcd61
2 changed files with 4 additions and 4 deletions
  1. +3
    -3
      README.md
  2. +1
    -1
      manager.go

+ 3
- 3
README.md View File

@ -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() {
// 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()

+ 1
- 1
manager.go View File

@ -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