-
Notifications
You must be signed in to change notification settings - Fork 547
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(endpoint-cache): add EndpointCache for Endpoint Discovery #2355
Conversation
Codecov Report
@@ Coverage Diff @@
## main #2355 +/- ##
=======================================
Coverage ? 60.15%
=======================================
Files ? 473
Lines ? 24900
Branches ? 5894
=======================================
Hits ? 14978
Misses ? 9922
Partials ? 0 Continue to review full report at Codecov.
|
In future, the callee may want to get all unexpired endpoints and add their own logic as more weights and priorities are added.
The callee will make decision based on value in Expires parameter as per SDK enhancement proposal.
TimeStream Service Developer Guide refers to CachePeriodInMinutes as Time to Live (TTL) value. It also specifies calls to be made for the duration of TTL. Refs: https://a.co/2e8J7xT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change is straightforward. Only have a minor question.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread. |
Issue
Refs: #2211
Description
adds EndpointCache for Endpoint Discovery:
mnemonist/lru-cache
for storing the cache.set
operation stores milliseconds elapsed since the UNIX epoch in Expires param based on CachePeriodInMinutes provided in Endpoint.get
operation returns a random un-expired endpoint.Testing
Unit tests
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.