Run ensures that the function fn is run and runs the notify function if interrupted meanwhile
(fn func() error, notify func())
| 107 | |
| 108 | // Run ensures that the function fn is run and runs the notify function if interrupted meanwhile |
| 109 | func (h *Handler) Run(fn func() error, notify func()) error { |
| 110 | id := uuid.New().String() |
| 111 | h.register(id, notify) |
| 112 | defer h.unregister(id) |
| 113 | |
| 114 | return fn() |
| 115 | } |
| 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 { |
nothing calls this directly
no test coverage detected