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
()
| 2326 | // based on the subscription current delivered index and the target. |
| 2327 | // Runs under subscription lock |
| 2328 | func (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 |
no test coverage detected