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

Precise unit for sleep duration and wake time #2278

Merged
merged 1 commit into from
May 19, 2022

Conversation

szpak
Copy link
Contributor

@szpak szpak commented May 18, 2022

Prior to, it was required to dig a few levels into to realize they are in millis.

I'm not satisfied with the new names of the field, but I wanted to express that nackSleep is a duration and nackWake is a point of time (the same as currentTimeMillis()). Nevertheless, as they are used internally, it might be sufficient to just change sleep to sleepMillis in the method argument (+ change the javadoc).

java.time.Duriation in the Acknowledgment class would be probably better, however, it is a non-backward compatible change.

@garyrussell
Copy link
Contributor

Given that the nack methods are default methods; I would not object to adding new overloaded methods taking a duration and deprecate the current ones.

@szpak
Copy link
Contributor Author

szpak commented May 19, 2022

Given that the nack methods are default methods; I would not object to adding new overloaded methods taking a duration and deprecate the current ones.

Great. However, as it's a slightly more complicated change, I propose to merge this one as is (with just the "millis" only) and I will create a new one with Duration later on to keep it separate.

Prior to, it was required to dig a few levels into to realize they are in millis.
@garyrussell
Copy link
Contributor

Thanks; agreed; in future, please just add more commits rather than squashing and force-pushing; it's easier to see what changed (not really a problem for small PRs like this, but important for larger ones). We will squash during the merge.

@garyrussell garyrussell merged commit 93f5ae5 into spring-projects:main May 19, 2022
@garyrussell
Copy link
Contributor

Thanks; cherry-picked to 2.9.x, 2.8.x.

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.

2 participants