MCPcopy
hub / github.com/nats-io/nats.go / checkForFlowControlResponse

Method checkForFlowControlResponse

js.go:2328–2338  ·  view source on GitHub ↗

checkForFlowControlResponse will check to see if we should send a flow control response based on the subscription current delivered index and the target. Runs under subscription lock

()

Source from the content-addressed store, hash-verified

2326// based on the subscription current delivered index and the target.
2327// Runs under subscription lock
2328func (sub *Subscription) checkForFlowControlResponse() string {
2329 // Caller has verified that there is a sub.jsi and fc
2330 jsi := sub.jsi
2331 jsi.active = true
2332 if sub.getJSDelivered() >= jsi.fcd {
2333 fcr := jsi.fcr
2334 jsi.fcr, jsi.fcd = _EMPTY_, 0
2335 return fcr
2336 }
2337 return _EMPTY_
2338}
2339
2340// Record an inbound flow control message.
2341// Runs under subscription lock

Callers 4

waitForMsgsMethod · 0.80
processMsgMethod · 0.80

Calls 1

getJSDeliveredMethod · 0.95

Tested by

no test coverage detected