Skip to content

ExpireAfter Max Time #951

Answered by ben-manes
wxjlibra asked this question in Q&A
May 8, 2023 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Yes, it should work with Long.MAX_VALUE as the duration. The internal restrictions apply to how far forward the Ticker can jump, which might occur with a unit test or otherwise fake time source. These constraints were to simplify the logic as considered out of scope as reasonable user behavior, but would not be harmful if violated.

// If wrapping then temporarily shift the clock for a positive comparison. We assume that the
// advancements never exceed a total running time of Long.MAX_VALUE nanoseconds (292 years)
// so that an overflow only occurs due to usin…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ben-manes
Comment options

Answer selected by ben-manes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants