Handler guarantees execution of notifications after a critical section (the function passed to a Run method), even in the presence of process termination. It guarantees exactly once invocation of the provided notify functions.
| 38 | // to a Run method), even in the presence of process termination. It guarantees exactly once |
| 39 | // invocation of the provided notify functions. |
| 40 | type Handler struct { |
| 41 | notifyMutex sync.Mutex |
| 42 | notify []notify |
| 43 | final func(os.Signal) |
| 44 | once sync.Once |
| 45 | |
| 46 | channelMutex sync.Mutex |
| 47 | channel chan os.Signal |
| 48 | } |
| 49 | |
| 50 | type notify struct { |
| 51 | id string |
nothing calls this directly
no outgoing calls
no test coverage detected