Skip to content

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

Open
jsonbailey wants to merge 4 commits into
mainfrom
jb/sdk-2768/async-config
Open

feat: Add AsyncConfig for the async SDK client#471
jsonbailey wants to merge 4 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
Large new configuration surface and async lifecycle contracts affect how the async client will connect, store flags, and send events; behavior is experimental but touches core SDK integration points.

Overview
Introduces AsyncConfig for AsyncLDClient, paralleling sync Config: URIs, streaming/polling, events, privacy, big segments, hooks/plugins, HTTP, payload filters, and experimental data-system settings. Defaults to AsyncInMemoryFeatureStore, filters AsyncHook / AsyncPlugin, and is marked experimental in docs.

config.py adds shared DEFAULT_BASE_URI, DEFAULT_EVENTS_URI, and DEFAULT_STREAM_URI; sync Config now uses those constants instead of inline URLs.

interfaces.py adds AsyncUpdateProcessor and AsyncEventProcessor (async stop) as the extension points wired from AsyncConfig for upcoming async polling and event processing.

Reviewed by Cursor Bugbot for commit 6a5ca9c. 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 Outdated
…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.
Match sync Config, which always defaults to an in-memory store when
none is provided, so callers and the async client can rely on a
non-null feature store.
@jsonbailey
jsonbailey marked this pull request as ready for review July 28, 2026 16:15
@jsonbailey
jsonbailey requested a review from a team as a code owner July 28, 2026 16:15
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