( clock quartz.Clock, timeout time.Duration, cancel context.CancelCauseFunc, )
| 806 | } |
| 807 | |
| 808 | func newStreamSilenceGuard( |
| 809 | clock quartz.Clock, |
| 810 | timeout time.Duration, |
| 811 | cancel context.CancelCauseFunc, |
| 812 | ) *streamSilenceGuard { |
| 813 | guard := &streamSilenceGuard{ |
| 814 | cancel: cancel, |
| 815 | timeout: timeout, |
| 816 | } |
| 817 | guard.timer = clock.AfterFunc( |
| 818 | timeout, |
| 819 | guard.onTimeout, |
| 820 | streamSilenceGuardTimerTag, |
| 821 | ) |
| 822 | return guard |
| 823 | } |
| 824 | |
| 825 | func (g *streamSilenceGuard) settle() bool { |
| 826 | g.mu.Lock() |
no outgoing calls