MCPcopy
hub / github.com/grpc/grpc-go / resetIdleTimerLocked

Method resetIdleTimerLocked

internal/idle/idle.go:85–96  ·  view source on GitHub ↗

resetIdleTimerLocked resets the idle timer to the given duration. Called when exiting idle mode or when the timer fires and we need to reset it.

(d time.Duration)

Source from the content-addressed store, hash-verified

83// resetIdleTimerLocked resets the idle timer to the given duration. Called
84// when exiting idle mode or when the timer fires and we need to reset it.
85func (m *Manager) resetIdleTimerLocked(d time.Duration) {
86 if m.isClosed() || m.timeout == 0 || m.actuallyIdle {
87 return
88 }
89
90 // It is safe to ignore the return value from Reset() because this method is
91 // only ever called from the timer callback or when exiting idle mode.
92 if m.timer != nil {
93 m.timer.Stop()
94 }
95 m.timer = timeAfterFunc(d, m.handleIdleTimeout)
96}
97
98func (m *Manager) resetIdleTimer(d time.Duration) {
99 m.idleMu.Lock()

Callers 3

resetIdleTimerMethod · 0.95
ExitIdleModeMethod · 0.95
UnsafeSetNotIdleMethod · 0.95

Calls 2

isClosedMethod · 0.95
StopMethod · 0.65

Tested by

no test coverage detected