RunAlways ensures that the function fn is run and runs the notify function if interrupted meanwhile or the function has ended
(fn func() error, notify func())
| 116 | |
| 117 | // RunAlways ensures that the function fn is run and runs the notify function if interrupted meanwhile or the function has ended |
| 118 | func (h *Handler) RunAlways(fn func() error, notify func()) error { |
| 119 | defer notify() |
| 120 | |
| 121 | id := uuid.New().String() |
| 122 | h.register(id, notify) |
| 123 | defer h.unregister(id) |
| 124 | |
| 125 | return fn() |
| 126 | } |
| 127 | |
| 128 | // Start ensures the handler is started and ready for incoming signals |
| 129 | func (h *Handler) Start() { |
nothing calls this directly
no test coverage detected