-
Notifications
You must be signed in to change notification settings - Fork 55
Implement Bounded Resource Consumption #42
Conversation
|
|
||
| if (config.offline || config.useLdd) { | ||
| logger.info("Starting LaunchDarkly client in offline mode"); | ||
| setOffline(); |
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.
One of the changes in the go-client is that this bit of state is now immutable. If that's the case then we should eliminate setOffline / setOnline and we no longer need a thread-safe volatile boolean for offline-- it should just be a final.
| */ | ||
| public LDClient(String apiKey) { | ||
| this(apiKey, LDConfig.DEFAULT); | ||
| public LDClient(String apiKey, Long waitForMillis) { |
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.
Why not an unboxed long?
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.
Muscle memory from Scala... I'll change it
|
This passes both streaming and non-streaming integration harnesses. I'd like to close this out before moving on to other client changes- Thumbs pls @jkodumal ? |
| @Override | ||
| public boolean initialized() { | ||
| return initialized && config.featureStore.initialized(); | ||
| return initialized.get() && config.featureStore.initialized(); |
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.
Still need to remove the check on the featurestore here.
| private static final int DEFAULT_SOCKET_TIMEOUT = 10000; | ||
| private static final int DEFAULT_FLUSH_INTERVAL = 5; | ||
| private static final long DEFAULT_POLLING_INTERVAL_MILLIS = 1000L; | ||
| private static final long DEFAULT_START_WAIT_MILLIS = 0L; |
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 think the most sensible behavior is to set this to something like 5 seconds, as that's how we'd want most customers to use it.
|
I suggest changing the default wait time, but otherwise |
Add event sampling. Name threads.
Implementing these changes: launchdarkly/go-client#37