feat!: Add a start wait time option for initialization - #71
Draft
kinyoklion wants to merge 1 commit into
Draft
kinyoklion wants to merge 1 commit into
kinyoklion wants to merge 1 commit into
Conversation
Co-Authored-By: rlamb@launchdarkly.com <4955475+kinyoklion@users.noreply.github.com>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
3 tasks
Contributor
|
@cursor review |
Draft
3 tasks
3 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Aligns initialization with the OpenFeature provider spec (OFP) start wait requirements, so waiting for the client is bounded instead of unbounded.
Provider(Configuration config, TimeSpan? startWait)constructorInitializeAsyncthen reports the outcome without waiting againTimeSpan.Zerowaits nowhere; readiness is reported through provider eventsnullwaits indefinitely for the data source to become valid or fail permanentlyInitializeAsyncno longer waits indefinitely after a configuredStartWaitTimeelapsesImplementation details
Requirements
Describe the solution you've provided
InitializeAsyncstill registers the flag and data source listeners and checks the current data source status. Only the indefinite mode leaves the initialization task pending; every other mode completes it with the outcome that is known at that point, so initialization does not wait a second time after the LaunchDarkly client constructor has already waited.The README feature matrix row for initialization and the asynchronous initialization section were updated to describe the three modes.
Describe alternatives you've considered
Interpreting a timeout only inside
InitializeAsyncwould wait twice whenStartWaitTimeis also configured, and OFP treats the start wait time as a bound over construction plus initialization.Additional context
Sibling changes for the same OFP requirement: launchdarkly/openfeature-java-server#66, launchdarkly/openfeature-python-server#64, launchdarkly/openfeature-ruby-server#36.
Out of scope, per the audit request: the dependency injection package and the client-side paradigm.
Verified with
dotnet test -f net8.0(71 tests pass).Link to Devin session: https://app.devin.ai/sessions/1fd3fcbfe79f482e8b58be29e8df2ffb
Open in Devin Desktop: https://app.devin.ai/desktop/session/1fd3fcbfe79f482e8b58be29e8df2ffb?variant=devin
Requested by: @kinyoklion