crossoverJie commented on code in PR #1197:
URL: https://github.com/apache/pulsar-client-go/pull/1197#discussion_r1671813541


##########
pulsar/backoff/backoff.go:
##########
@@ -15,7 +15,7 @@
 // specific language governing permissions and limitations
 // under the License.
 
-package internal
+package backoff

Review Comment:
   This will lead to a circular dependency.
   
   
https://github.com/apache/pulsar-client-go/blob/master/pulsar/internal/http_client.go#L151



##########
pulsar/backoff/backoff.go:
##########
@@ -26,10 +26,14 @@ func init() {
        rand.Seed(time.Now().UnixNano())
 }
 
-// BackoffPolicy parameterize the following options in the reconnection logic 
to
+// Policy parameterize the following options in the reconnection logic to
 // allow users to customize the reconnection logic (minBackoff, maxBackoff and 
jitterPercentage)
-type BackoffPolicy interface {
+type Policy interface {
+       // Next returns the delay to wait before next retry
        Next() time.Duration
+
+       // IsMaxBackoffReached evaluates if the max number of retries is reached
+       IsMaxBackoffReached(delayReconnectTime, totalDelayReconnectTime 
time.Duration) bool

Review Comment:
   Done.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to