Skip to content

feat: Add async FDv1 streaming and data source status tracking#464

Draft
jsonbailey wants to merge 2 commits into
mainfrom
jb/sdk-2743/async-fdv1-streaming
Draft

feat: Add async FDv1 streaming and data source status tracking#464
jsonbailey wants to merge 2 commits into
mainfrom
jb/sdk-2743/async-fdv1-streaming

Conversation

@jsonbailey

@jsonbailey jsonbailey commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Overview

Adds the async FDv1 streaming data source and its companion async data source status tracking, plus a new shared sans-I/O datasource_common module. This is one slice of the async Python SDK work.

What's included

  • Async FDv1 streaming data source (ldclient/impl/datasource/async_streaming.py) — driven by ld_eventsource's AsyncSSEClient and owning its own aiohttp session via make_client_session. It consumes SSE put/patch/delete events and pushes the resulting data into the async data source update sink.

  • Async data source status tracking (ldclient/impl/datasource/async_status.pyAsyncDataSourceUpdateSinkImpl and friends). The streaming source pushes data and status transitions into this update sink, so the two are runtime-coupled and land together in this slice.

  • New shared sans-I/O datasource_common module (ldclient/impl/datasource/datasource_common.py) — STREAM_ALL_PATH, sink_or_store, and parse_path. Both the sync data sources and the new async streaming source use it.

  • Behavior-preserving extraction of the sync data sources. streaming.py and polling.py are routed through datasource_common: the inline _sink_or_store/_parse_path/STREAM_ALL_PATH/ParsedPath definitions are removed in favor of importing the shared helpers, with call sites switched accordingly. No behavior change. The shared module is also needed by the upcoming async polling slice.

  • Unified status provider (sync/async). The async status provider was unified with the sync one: the redundant AsyncDataSourceStatusProviderImpl (which had no async-specific behavior — byte-identical to the sync provider apart from its sink type) is removed, and the async data system now reuses the sync DataSourceStatusProviderImpl. To let both sinks satisfy it structurally, the sync provider's update_sink parameter was widened to a small status-only Protocol (_DataSourceStatusSource). This is the same interface-segregation pattern as the PR 1b config read-protocols and mirrors the already-unified big-segment status provider. This adds a small behavior-preserving change to sync status.py.

Notes

  • The async public class carries the experimental .. caution:: block.
  • No CHANGELOG entries or version bumps (handled at release time).

Tracked internally: SDK-2743

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