-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add an optional param to provide assignmentCache solution; fallback t… #61
base: main
Are you sure you want to change the base?
Conversation
@@ -61,6 +67,8 @@ export interface IClientConfig { | |||
* Poll for new configurations even if the initial configuration request failed. (default: false) | |||
*/ | |||
pollAfterFailedInitialization?: boolean; | |||
|
|||
disablePolling?: boolean; |
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.
Consider passing a persistentStore
instead which implements isExpired
the way you want it:
- interface: https://github.com/Eppo-exp/js-client-sdk/blob/main/src/index.ts#L79
- we have an implementation of a
chrome.storage
backed store that supports a "cooldown" for example: https://github.com/Eppo-exp/js-client-sdk/blob/main/src/chrome.configuration-store.ts#L14 - users on aws lambda can provide a store that reads from dynamodb or redis to avoid fetching from CDN
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.
Agreed, I think we want to do what Leo said and then expose pollAfterSuccessfulInitialization
to prevent polling.
@@ -61,6 +67,8 @@ export interface IClientConfig { | |||
* Poll for new configurations even if the initial configuration request failed. (default: false) | |||
*/ | |||
pollAfterFailedInitialization?: boolean; | |||
|
|||
disablePolling?: boolean; |
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.
Agreed, I think we want to do what Leo said and then expose pollAfterSuccessfulInitialization
to prevent polling.
/** | ||
* (optional) Provide your own caching solution. If not defined, LRU cache will be used. | ||
*/ | ||
assignmentCache?: AssignmentCache<Cacheable>; |
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.
I like being able to pass in the assignment cache 👍
The Vercel implementation will use their edge file
…o LRU
Fixes: #issue
Motivation and Context
Description
How has this been tested?