Closed sunng87 closed 3 years ago
@sunng87 Will do. Is this a blocker for you to get to 3.0? How soon do you need this?
As a temporary workaround, isn't it possible to treat a Builder instance as effectively being a kind of non-queryable Config? Builders aren't automatically safe to share between threads, but if you take care, you could re-use Builders to get the effect of constructing a Builder from a Config.
I just pushed 311ff96 which adds builder(PolicyConfig)
to each of the policy types. It also relaxes some of the illegal state validation in RetryPolicyBuilder
so that different types of delays can be configured to replace previous configuration, and relaxes the requirement that a jitter be configured after a delay. This should make RetryPolicyBuilder
a bit more flexible.
Closing, but feel free to reopen if you see any problem with the commit. I'll probably release this as part of 3.0.1 in the next few days.
Thank you for fast response. I confirm the change in 311ff96 fixed the issue for me.
Sure - I just released 3.0.1 with this change. It should be synced to Maven central in a few hours.
With new separation of builder and config APIs, it would be nice to be able to create a builder from an existed config, with which we can copy a pre-configured policy, like
.copy
API from 2.x.For example, a
withConfig
method in builder to accept aXXXConfig
and copy all the data into the builder. We can still have further customizations by calling otherwithXXX
APIs from the builder.