From 005f0e6a1798bdceb821e8f9662b677c28c43f67 Mon Sep 17 00:00:00 2001 From: Sylvain Rabot Date: Wed, 5 Oct 2022 17:52:58 +0200 Subject: [PATCH 1/2] Improve durable consumer unsubscribe comment Signed-off-by: Sylvain Rabot --- js.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js.go b/js.go index e34b297d9..3e459edc6 100644 --- a/js.go +++ b/js.go @@ -67,9 +67,11 @@ type JetStream interface { // gone. // * If Durable() option is specified, the library will attempt to lookup a JetStream // consumer with this name, and if found, will bind to it and not attempt to - // delete it. However, if not found, the library will send a request to create - // such durable JetStream consumer. The library will delete the JetStream consumer - // after an Unsubscribe() or Drain(). + // delete it. However, if not found, the library will send a request to + // create such durable JetStream consumer. Note that the library will delete + // the JetStream consumer after an Unsubscribe() or Drain() *only* if it + // created the durable consumer while subscribing. if the durable consumer + // already existed prior to subscribing it won't be deleted. // * If Bind() option is provided, the library will attempt to lookup the // consumer with the given name, and if successful, bind to it. If the lookup fails, // then the Subscribe() call will return an error. From f79575ea24a3fbcc4ee2dc0a33ee2d725dbc2995 Mon Sep 17 00:00:00 2001 From: Sylvain Rabot Date: Thu, 6 Oct 2022 17:05:04 +0200 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Piotr Piotrowski --- js.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js.go b/js.go index 3e459edc6..d391ab81d 100644 --- a/js.go +++ b/js.go @@ -69,8 +69,8 @@ type JetStream interface { // consumer with this name, and if found, will bind to it and not attempt to // delete it. However, if not found, the library will send a request to // create such durable JetStream consumer. Note that the library will delete - // the JetStream consumer after an Unsubscribe() or Drain() *only* if it - // created the durable consumer while subscribing. if the durable consumer + // the JetStream consumer after an Unsubscribe() or Drain() only if it + // created the durable consumer while subscribing. If the durable consumer // already existed prior to subscribing it won't be deleted. // * If Bind() option is provided, the library will attempt to lookup the // consumer with the given name, and if successful, bind to it. If the lookup fails,