Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add overloads for Consul.Builder#withMultipleHostAndPort that accept Duration and amount/TimeUnit #321

Closed
sleberknight opened this issue Dec 19, 2023 · 0 comments · Fixed by #323
Assignees
Labels
enhancement A request for change or improvement to an existing feature
Milestone

Comments

@sleberknight
Copy link
Member

Overload withMultipleHostAndPort so that it also accepts an java.time.Duration or an amount and TimeUnit, which covers most cases where you would prefer to use something nicer than the number of milliseconds.

The signatures of the overloads are:

public Builder withMultipleHostAndPort(Collection<HostAndPort> hostAndPort, long blocklistTime, TimeUnit blocklistTimeUnit)

public Builder withMultipleHostAndPort(Collection<HostAndPort> hostAndPort, Duration blocklistTime)
@sleberknight sleberknight added the enhancement A request for change or improvement to an existing feature label Dec 19, 2023
@sleberknight sleberknight added this to the 1.3.0 milestone Dec 19, 2023
@sleberknight sleberknight self-assigned this Dec 19, 2023
sleberknight added a commit that referenced this issue Dec 20, 2023
* Add overload that accepts a java.time.Duration
* Add overload that accepts a (long) timeout amount and a TimeUnit

Closes #321
sleberknight added a commit that referenced this issue Dec 20, 2023
* Add overloads for withMultipleHostAndPort in Consul.Builder

* Add overload that accepts a java.time.Duration
* Add overload that accepts a (long) timeout amount and a TimeUnit

Closes #321
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A request for change or improvement to an existing feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant