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

Method deleteConsumer

js.go:1452–1468  ·  view source on GitHub ↗

Deletes the JS Consumer. No connection nor subscription lock must be held on entry.

()

Source from the content-addressed store, hash-verified

1450// Deletes the JS Consumer.
1451// No connection nor subscription lock must be held on entry.
1452func (sub *Subscription) deleteConsumer() error {
1453 sub.mu.Lock()
1454 jsi := sub.jsi
1455 if jsi == nil {
1456 sub.mu.Unlock()
1457 return nil
1458 }
1459 if jsi.stream == _EMPTY_ || jsi.consumer == _EMPTY_ {
1460 sub.mu.Unlock()
1461 return nil
1462 }
1463 stream, consumer := jsi.stream, jsi.consumer
1464 js := jsi.js
1465 sub.mu.Unlock()
1466
1467 return js.DeleteConsumer(stream, consumer)
1468}
1469
1470// SubOpt configures options for subscribing to JetStream consumers.
1471type SubOpt interface {

Callers 2

UnsubscribeMethod · 0.95
checkDrainedMethod · 0.80

Calls 1

DeleteConsumerMethod · 0.65

Tested by

no test coverage detected