Browse Source

better naming

master
Chakib Benziane 1 year 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.
6 6
 Features:
7 7
 
8 8
 - Scheduling of multiple goroutines.
9
-- Subscribe to `os.Signal` events.
9
+- Shutdown on `os.Signal` events.
10 10
 - Gracefull shutdown of units
11 11
 
12 12
 
@@ -70,8 +70,8 @@ func main() {
70 70
     // Create a unit manager
71 71
     manager := gum.NewManager()
72 72
 
73
-    // Subscribe to SIGINT
74
-    manager.SubscribeTo(os.Interrupt)
73
+    // Shutdown all units on SIGINT
74
+    manager.ShutdownOn(os.Interrupt)
75 75
 
76 76
     // NewWorker returns a type implementing WorkUnit interface unit :=
77 77
     worker := NewWorker()

+ 1
- 1
manager.go View File

@@ -78,7 +78,7 @@ func (m *Manager) Start() {
78 78
 	}
79 79
 }
80 80
 
81
-func (m *Manager) SubscribeTo(sig os.Signal) {
81
+func (m *Manager) ShutdownOn(sig os.Signal) {
82 82
 	signal.Notify(m.signal, sig)
83 83
 }
84 84
 

Loading…
Cancel
Save