MCPcopy
hub / github.com/segmentio/kafka-go / adjustDeadlineForRTT

Function adjustDeadlineForRTT

time.go:49–58  ·  view source on GitHub ↗
(deadline time.Time, now time.Time, rtt time.Duration)

Source from the content-addressed store, hash-verified

47}
48
49func adjustDeadlineForRTT(deadline time.Time, now time.Time, rtt time.Duration) time.Time {
50 if !deadline.IsZero() {
51 timeout := deadline.Sub(now)
52 if timeout < rtt {
53 rtt = timeout / 4
54 }
55 deadline = deadline.Add(-rtt)
56 }
57 return deadline
58}

Callers 4

ReadBatchWithMethod · 0.85
deleteTopicsMethod · 0.85
createTopicsMethod · 0.85

Calls 1

IsZeroMethod · 0.80

Tested by

no test coverage detected