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

api: add helper methods for Suppliers #1086

Merged
merged 3 commits into from
Oct 25, 2023

Conversation

brharrington
Copy link
Contributor

Adds methods to the Timer interface to make it easier to work with the Supplier types in the JDK. There is already a method that works with Callable, but since that throws Exception it can be cumbersome to use in code. Methods have also been added for the suppliers with primitive types to avoid boxing.

Overload resolution can be messy with lambdas. To avoid those issues record methods have been added with a different name for each interface. The existing record methods for Callable and Runnable have been deprecated in favor of the more specifically named method.

Fixes #566.

Adds methods to the Timer interface to make it easier to
work with the Supplier types in the JDK. There is already
a method that works with Callable, but since that throws
Exception it can be cumbersome to use in code. Methods have
also been added for the suppliers with primitive types to
avoid boxing.

Overload resolution can be messy with lambdas. To avoid
those issues record methods have been added with a different
name for each interface. The existing record methods for
Callable and Runnable have been deprecated in favor of the
more specifically named method.

Fixes Netflix#566.
@brharrington brharrington added this to the 1.7.0 milestone Oct 20, 2023
@brharrington brharrington merged commit 4a6e64d into Netflix:main Oct 25, 2023
1 check passed
@brharrington brharrington deleted the issue-566 branch October 25, 2023 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for java.util.function.Supplier timing to Timer
1 participant