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

Method realReplenish

internal/transport/flowcontrol.go:69–79  ·  view source on GitHub ↗
(n int)

Source from the content-addressed store, hash-verified

67}
68
69func (w *writeQuota) realReplenish(n int) {
70 sz := int32(n)
71 newQuota := atomic.AddInt32(&w.quota, sz)
72 previousQuota := newQuota - sz
73 if previousQuota <= 0 && newQuota > 0 {
74 select {
75 case w.ch <- struct{}{}:
76 default:
77 }
78 }
79}
80
81type trInFlow struct {
82 limit uint32

Callers 2

handleStreamDelayReadMethod · 0.80

Calls

no outgoing calls

Tested by 2

handleStreamDelayReadMethod · 0.64