Deletes the JS Consumer. No connection nor subscription lock must be held on entry.
()
| 1450 | // Deletes the JS Consumer. |
| 1451 | // No connection nor subscription lock must be held on entry. |
| 1452 | func (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. |
| 1471 | type SubOpt interface { |
no test coverage detected