merlimat commented on code in PR #25657:
URL: https://github.com/apache/pulsar/pull/25657#discussion_r3178461519
##########
pulsar-client-api-v5/src/main/java/org/apache/pulsar/client/api/v5/config/BackoffPolicy.java:
##########
@@ -20,27 +20,55 @@
import java.time.Duration;
import java.util.Objects;
+import lombok.EqualsAndHashCode;
+import lombok.ToString;
/**
* Backoff configuration for broker reconnection attempts.
*
* <p>The delay for attempt {@code n} is {@code min(initialInterval *
multiplier^(n-1), maxInterval)}.
*
- * @param initialInterval the delay before the first reconnection attempt
- * @param maxInterval the maximum delay between reconnection attempts
- * @param multiplier the multiplier applied after each attempt
+ * <p>Use {@link #fixed(Duration, Duration)} or {@link #exponential(Duration,
Duration)} for
+ * the common cases, or {@link #builder()} to configure all knobs explicitly.
*/
-public record BackoffPolicy(
- Duration initialInterval,
- Duration maxInterval,
- double multiplier
-) {
- public BackoffPolicy {
+@EqualsAndHashCode
+@ToString
+public final class BackoffPolicy {
Review Comment:
eg: ` return Duration.ofMillis(Math.max(initialMillis,
currentMillis));`
but `initialMillis` is already the minimum and the first time
`currentMillis` is like `initialMillis - ~10%`
--
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]