feat: Add async feature store interface and in-memory implementation#457
Open
jsonbailey wants to merge 1 commit into
Open
feat: Add async feature store interface and in-memory implementation#457jsonbailey wants to merge 1 commit into
jsonbailey wants to merge 1 commit into
Conversation
Adds the async interfaces (AsyncFeatureStore, AsyncReadOnlyStore, AsyncDataSourceUpdateSink, AsyncBigSegmentStore, AsyncInitializer, AsyncSynchronizer), the AsyncInMemoryFeatureStore, and async test utilities. Stacked on the async support classes slice.
joker23
approved these changes
Jul 13, 2026
Comment on lines
+25
to
+28
| # No lock is needed: every method below reads and mutates ``_items`` | ||
| # without awaiting in between, so it runs to completion without the | ||
| # event loop switching to another coroutine. (The sync twin uses a | ||
| # real ``ReadWriteLock`` because threads can preempt each other.) |
Contributor
There was a problem hiding this comment.
nit: I don't think this comment is needed.
But I do think we should have an unit test to prove this statement.
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.
Tracked internally: SDK-2671
What
The async data-store foundation the async SDK builds on.
interfaces.py— async interfaces:AsyncFeatureStore,AsyncReadOnlyStore(asyncget/all; the async analog ofReadOnlyStore),AsyncDataSourceUpdateSink,AsyncBigSegmentStore,AsyncInitializer,AsyncSynchronizer. Pure additions alongside the existing sync interfaces.async_feature_store.py—AsyncInMemoryFeatureStore. Holds no lock: every method reads/mutates its dict without awaiting in between, so it runs to completion without the event loop switching coroutines (the sync twin needs aReadWriteLockbecause threads can preempt each other).testing/— async test utilities:mock_async_components.py,async_feature_store_test_base.py, andtest_async_in_memory_feature_store.py.Why
Foundation for the async Python SDK (epic SDK-60). Subsequent slices (async evaluator, big segments, data sources, data systems, client) depend on these interfaces and the in-memory store.
Validation
uv run pytest ldclient/testing/test_async_in_memory_feature_store.py— 17 passeduv run mypy ldclient— cleanEpic SDK-60.