MCPcopy
hub / github.com/marmotedu/iam / Signal

Method Signal

internal/iamctl/util/interrupt/interrupt.go:62–72  ·  view source on GitHub ↗

Signal is called when an os.Signal is received, and guarantees that all notifications are executed, then the final handler is executed. This function should only be called once per Handler instance.

(s os.Signal)

Source from the content-addressed store, hash-verified

60// are executed, then the final handler is executed. This function should only be called once
61// per Handler instance.
62func (h *Handler) Signal(s os.Signal) {
63 h.once.Do(func() {
64 for _, fn := range h.notify {
65 fn()
66 }
67 if h.final == nil {
68 os.Exit(1)
69 }
70 h.final(s)
71 })
72}
73
74// Run ensures that any notifications are invoked after the provided fn exits (even if the
75// process is interrupted by an OS termination signal). Notifications are only invoked once

Callers 1

RunMethod · 0.95

Implementers 1

RedisClusterpkg/storage/redis_cluster.go

Calls

no outgoing calls

Tested by

no test coverage detected