question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add java.time.Duration overloads to Suppliers.memoizeWithExpiration()

See original GitHub issue

Suppliers.memoizeWithExpiration() takes a TimeUnit. Consider adding a java.time.Duration overload similar to what you did with CacheBuilder.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:2
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
cowwoccommented, May 30, 2018

@kluever My 2 cents: all Guava APIs that expect a c.g.c.b.Supplier argument should allow j.u.f.Supplier as well. Where they don’t already do so, overloads should be added. I would even go so far as formally deprecating c.g.c.b.Supplier explicitly.

Once this is done, I see no benefit in returning com.google.common.base.Supplier.

0reactions
kluevercommented, Jun 4, 2018

@nikhilbarar thanks for the offer, but I actually have a pending change out for this - we just need to work through the Guava Supplier vs. JDK Supplier issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Suppliers.memoizeWithExpiration should take a duration ...
The Suppliers.memoizeWithExpiration function currently takes a fixed duration as an argument. I have a use case in a Jenkins plugin ...
Read more >
Introduction to Guava Memoizer - Baeldung
There are two methods in the Suppliers class that enable memoization: memoize, and memoizeWithExpiration. When we want to execute the memoized ...
Read more >
Suppliers Utility Class In Google Guava
Memoize with expiration. There is an overloaded memoize method which takes an expiration input (duration and its unit). Within this duration ...
Read more >
Suppliers (Guava: Google Core Libraries for Java 19.0 API)
Returns a supplier that caches the instance supplied by the delegate and removes the cached value after the specified time has passed. static...
Read more >
Guava: Google Core Libraries for Java 24.1.1-android API
add (String, Object) - Method in class com.google.common.base. ... Calls next() on iterator , either numberToAdvance times or until hasNext() returns false ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found