MCPcopy Create free account
hub / github.com/goinaction/code / run

Method run

chapter7/patterns/runner/runner.go:73–85  ·  view source on GitHub ↗

run executes each registered task.

()

Source from the content-addressed store, hash-verified

71
72// run executes each registered task.
73func (r *Runner) run() error {
74 for id, task := range r.tasks {
75 // Check for an interrupt signal from the OS.
76 if r.gotInterrupt() {
77 return ErrInterrupt
78 }
79
80 // Execute the registered task.
81 task(id)
82 }
83
84 return nil
85}
86
87// gotInterrupt verifies if the interrupt signal has been issued.
88func (r *Runner) gotInterrupt() bool {

Callers 1

StartMethod · 0.95

Calls 1

gotInterruptMethod · 0.95

Tested by

no test coverage detected