Skip to content

feat: Add AsyncConfig for the async SDK client - #471

Draft
jsonbailey wants to merge 3 commits into
mainfrom
jb/sdk-2768/async-config
Draft

feat: Add AsyncConfig for the async SDK client#471
jsonbailey wants to merge 3 commits into
mainfrom
jb/sdk-2768/async-config

Conversation

@jsonbailey

@jsonbailey jsonbailey commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Adds the full AsyncConfig class to ldclient/async_config.py, building on the previously-merged AsyncBigSegmentsConfig seed (#462). This is a stacked-PR slice of the async Python SDK epic (SDK-60), unblocked now that #463 merged AsyncHook/AsyncPlugin.

AsyncConfig mirrors the sync Config surface 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 concrete AsyncEventProcessor is imported only under TYPE_CHECKING to 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 (and AsyncBigSegmentsConfig) 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 Config path.

Overview
Introduces AsyncConfig in ldclient/async_config.py, giving AsyncLDClient a configuration surface aligned with sync Config (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 exports AsyncConfig alongside AsyncBigSegmentsConfig. Async-specific wiring uses AsyncFeatureStore, AsyncHook, AsyncPlugin, and factory hooks typed with AsyncEvent; AsyncEventProcessor is imported only under TYPE_CHECKING so 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.

@jsonbailey

Copy link
Copy Markdown
Contributor Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread ldclient/async_config.py
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant