feat: Add AsyncConfig for the async SDK client - #471
Draft
jsonbailey wants to merge 3 commits into
Draft
Conversation
Contributor
Author
|
@cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 23ca0b6. Configure here.
| self.__initial_reconnect_delay = initial_reconnect_delay | ||
| self.__poll_interval = max(poll_interval, 30.0) | ||
| self.__use_ldd = use_ldd | ||
| self.__feature_store = feature_store |
There was a problem hiding this comment.
Missing default feature store
Medium Severity
AsyncConfig stores a null feature_store when none is provided, unlike sync Config, which always defaults to an in-memory store. AsyncInMemoryFeatureStore already exists as that default, so callers and upcoming async client code that assume a non-null store can fail.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 23ca0b6. Configure here.
…interface Mirror how the sync Config types event_processor_class against the EventProcessor interface. Add an AsyncEventProcessor ABC to interfaces and reference it directly instead of the concrete implementation, which also removes the aiohttp-avoiding TYPE_CHECKING import.
Extract the default base/events/stream LaunchDarkly URIs into named constants in ldclient.config and reference them from both Config and AsyncConfig, so the two clients can't silently drift to different default endpoints. Also type update_processor_class against the AsyncUpdateProcessor interface rather than the sync UpdateProcessor.
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.


Adds the full
AsyncConfigclass toldclient/async_config.py, building on the previously-mergedAsyncBigSegmentsConfigseed (#462). This is a stacked-PR slice of the async Python SDK epic (SDK-60), unblocked now that #463 mergedAsyncHook/AsyncPlugin.AsyncConfigmirrors the syncConfigsurface for the async client: base/events/stream URIs, streaming vs. polling, event buffering, private attributes, big segments, hooks, plugins, HTTP config, application metadata, and the experimental data system config. The concreteAsyncEventProcessoris imported only underTYPE_CHECKINGto keep aiohttp out of the runtime import graph.This is self-contained and reviewable on its own. It unblocks the upcoming async FDv1 polling (PR 7) and async event processor (PR 8), both of which import the full
AsyncConfig.The public
AsyncConfig(andAsyncBigSegmentsConfig) carry an experimental.. caution::note — this API may change without notice and is not yet production-ready.Tracked internally: SDK-2768
Note
Medium Risk
Adds a large new experimental public API that mirrors sync client networking, events, and privacy settings; behavior is untested in this slice but does not alter the existing sync
Configpath.Overview
Introduces
AsyncConfiginldclient/async_config.py, givingAsyncLDClienta configuration surface aligned with syncConfig(URIs, streaming/polling, events, privacy, hooks/plugins, HTTP, big segments, payload filters, experimental data system).The module docstring is updated from a placeholder to document
AsyncConfig, and__all__now exportsAsyncConfigalongsideAsyncBigSegmentsConfig. Async-specific wiring usesAsyncFeatureStore,AsyncHook,AsyncPlugin, and factory hooks typed withAsyncEvent;AsyncEventProcessoris imported only underTYPE_CHECKINGso aiohttp stays off the runtime import path. Both public types carry an experimental.. caution::note.Reviewed by Cursor Bugbot for commit 23ca0b6. Bugbot is set up for automated code reviews on this repo. Configure here.