Drain will remove interest but continue callbacks until all messages have been processed. For a JetStream subscription, if the library has created the JetStream consumer, the library will send a DeleteConsumer request to the server when the drain operation completes. If a failure occurs when deleti
()
| 5064 | // ensure that the consumer is not created by the library, which means |
| 5065 | // create the consumer with AddConsumer and bind to this consumer. |
| 5066 | func (s *Subscription) Drain() error { |
| 5067 | if s == nil { |
| 5068 | return ErrBadSubscription |
| 5069 | } |
| 5070 | s.mu.Lock() |
| 5071 | conn := s.conn |
| 5072 | s.mu.Unlock() |
| 5073 | if conn == nil { |
| 5074 | return ErrBadSubscription |
| 5075 | } |
| 5076 | return conn.unsubscribe(s, 0, true) |
| 5077 | } |
| 5078 | |
| 5079 | // IsDraining returns a boolean indicating whether the subscription |
| 5080 | // is being drained. |
nothing calls this directly
no test coverage detected