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

Method getJSDelivered

js.go:2318–2323  ·  view source on GitHub ↗

For jetstream subscriptions, returns the number of delivered messages. For ChanSubscription, this value is computed based on the known number of messages added to the channel minus the current size of that channel. Lock held on entry

()

Source from the content-addressed store, hash-verified

2316// of messages added to the channel minus the current size of that channel.
2317// Lock held on entry
2318func (sub *Subscription) getJSDelivered() uint64 {
2319 if sub.typ == ChanSubscription {
2320 return sub.jsi.fciseq - uint64(len(sub.mch))
2321 }
2322 return sub.delivered
2323}
2324
2325// checkForFlowControlResponse will check to see if we should send a flow control response
2326// based on the subscription current delivered index and the target.

Callers 2

processMsgMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected