-
Notifications
You must be signed in to change notification settings - Fork 48
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
feat(mutableGet): commit local mutable record after it is dropped (unlike refresh) #110
base: main
Are you sure you want to change the base?
Conversation
Not sure I follow the logic can you expand a bit? Only the 20 closest nodes of the entire DHT can (effectively) pick the caching time, unless you get lucky and hit a random node on the way (lower the chance the bigger the dht) |
@mafintosh Didn't mean changing the caching time, I meant that applications might want to refresh a value every 60 minutes instead of every 20 minutes, but by then, the value would be dropped, and the current The alternative is to change |
Sorry I don't follow. Can you explain in super simple terms what this does? As I read the code it adding an option to get? |
Yes, it is adding |
Ie “refresh with this value if no other value exist” ? |
Yes, and set this new value if no newer value exists (but I don't have the keypair). Will submit a better unit test in a minute to highlight that use case. Edit: Updated unit test, hopefully the purpose of this PR is a bit more clear! |
31b7d8f
to
e50e423
Compare
This is helpful for applications that have different caching tolerance than the
20 min
before mutable records are dropped.For example, if an application is ok with a
60min TTL
, then it doesn't make sense to keep refreshing values 3 times as often.This PR will allow such applications to re-commit locally cached records at their leisure.