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

Method gotInterrupt

chapter7/patterns/runner/runner.go:88–100  ·  view source on GitHub ↗

gotInterrupt verifies if the interrupt signal has been issued.

()

Source from the content-addressed store, hash-verified

86
87// gotInterrupt verifies if the interrupt signal has been issued.
88func (r *Runner) gotInterrupt() bool {
89 select {
90 // Signaled when an interrupt event is sent.
91 case <-r.interrupt:
92 // Stop receiving any further signals.
93 signal.Stop(r.interrupt)
94 return true
95
96 // Continue running as normal.
97 default:
98 return false
99 }
100}

Callers 1

runMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected