Skip to content

feat: Add async feature store interface and in-memory implementation#457

Open
jsonbailey wants to merge 1 commit into
jb/sdk-2601/async-shim-layerfrom
jb/sdk-60/async-feature-store
Open

feat: Add async feature store interface and in-memory implementation#457
jsonbailey wants to merge 1 commit into
jb/sdk-2601/async-shim-layerfrom
jb/sdk-60/async-feature-store

Conversation

@jsonbailey

@jsonbailey jsonbailey commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Stacked on #451 (async support classes). Review/merge that first; this PR's diff is against that branch.

Tracked internally: SDK-2671

What

The async data-store foundation the async SDK builds on.

  • interfaces.py — async interfaces: AsyncFeatureStore, AsyncReadOnlyStore (async get/all; the async analog of ReadOnlyStore), AsyncDataSourceUpdateSink, AsyncBigSegmentStore, AsyncInitializer, AsyncSynchronizer. Pure additions alongside the existing sync interfaces.
  • async_feature_store.pyAsyncInMemoryFeatureStore. 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 a ReadWriteLock because threads can preempt each other).
  • testing/ — async test utilities: mock_async_components.py, async_feature_store_test_base.py, and test_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 passed
  • uv run mypy ldclient — clean
  • isort / pycodestyle — clean

Epic SDK-60.

Adds the async interfaces (AsyncFeatureStore, AsyncReadOnlyStore, AsyncDataSourceUpdateSink, AsyncBigSegmentStore, AsyncInitializer, AsyncSynchronizer), the AsyncInMemoryFeatureStore, and async test utilities. Stacked on the async support classes slice.
@jsonbailey jsonbailey marked this pull request as ready for review July 10, 2026 22:40
@jsonbailey jsonbailey requested a review from a team as a code owner July 10, 2026 22:40
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.)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I don't think this comment is needed.

But I do think we should have an unit test to prove this statement.

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