Skip to content

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

Merged
jsonbailey merged 6 commits into
mainfrom
jb/sdk-2768/async-config
Jul 29, 2026
Merged

feat: Add AsyncConfig for the async SDK client#471
jsonbailey merged 6 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 experimental configuration surface touches networking, events, and data-source wiring for the async client, though behavior is additive and sync Config changes are limited to shared constants.

Overview
Adds AsyncConfig in ldclient/async_config.py so AsyncLDClient can be configured with the same knobs as sync Config: endpoints, streaming/polling, events, privacy, big segments, hooks/plugins, HTTP, payload filtering, and experimental data-system settings. It wires in AsyncFeatureStore (default AsyncInMemoryFeatureStore), AsyncHook / AsyncPlugin, and factory hooks for AsyncUpdateProcessor and AsyncEventProcessor, with experimental .. caution:: on the public API.

Sync Config now reuses shared DEFAULT_*_URI constants instead of inline URL literals.

interfaces.py gains experimental AsyncUpdateProcessor and AsyncEventProcessor (async stop, plus flush_and_wait on the event processor) for upcoming async polling and event delivery.

Reviewed by Cursor Bugbot for commit 3303a25. 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
Comment thread ldclient/interfaces.py
is_alive is never called on the async path; it was only mirrored from
the sync UpdateProcessor's BackgroundOperation base. The async interface
is defined fresh, so it omits the vestigial method.
Declares a coroutine that flushes buffered events and waits for delivery,
returning whether it completed within the given timeout. Mirrors .NET's
FlushAndWait; the sync EventProcessor has no equivalent.
@jsonbailey
jsonbailey merged commit 0587a78 into main Jul 29, 2026
15 checks passed
@jsonbailey
jsonbailey deleted the jb/sdk-2768/async-config branch July 29, 2026 19:25
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.

2 participants