feat: Add async FDv1 streaming and data source status tracking#464
Draft
jsonbailey wants to merge 2 commits into
Draft
feat: Add async FDv1 streaming and data source status tracking#464jsonbailey wants to merge 2 commits into
jsonbailey wants to merge 2 commits into
Conversation
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.
Overview
Adds the async FDv1 streaming data source and its companion async data source status tracking, plus a new shared sans-I/O
datasource_commonmodule. 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 byld_eventsource'sAsyncSSEClientand owning its ownaiohttpsession viamake_client_session. It consumes SSEput/patch/deleteevents and pushes the resulting data into the async data source update sink.Async data source status tracking (
ldclient/impl/datasource/async_status.py—AsyncDataSourceUpdateSinkImpland 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_commonmodule (ldclient/impl/datasource/datasource_common.py) —STREAM_ALL_PATH,sink_or_store, andparse_path. Both the sync data sources and the new async streaming source use it.Behavior-preserving extraction of the sync data sources.
streaming.pyandpolling.pyare routed throughdatasource_common: the inline_sink_or_store/_parse_path/STREAM_ALL_PATH/ParsedPathdefinitions 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 syncDataSourceStatusProviderImpl. To let both sinks satisfy it structurally, the sync provider'supdate_sinkparameter was widened to a small status-onlyProtocol(_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 syncstatus.py.Notes
.. caution::block.Tracked internally: SDK-2743