MCPcopy Index your code
hub / github.com/devspace-sh/devspace / Run

Method Run

pkg/util/interrupt/interrupt.go:109–115  ·  view source on GitHub ↗

Run ensures that the function fn is run and runs the notify function if interrupted meanwhile

(fn func() error, notify func())

Source from the content-addressed store, hash-verified

107
108// Run ensures that the function fn is run and runs the notify function if interrupted meanwhile
109func (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
118func (h *Handler) RunAlways(fn func() error, notify func()) error {

Callers

nothing calls this directly

Calls 3

registerMethod · 0.95
unregisterMethod · 0.95
StringMethod · 0.45

Tested by

no test coverage detected