feat: Add async Consul persistent feature store - #491
Draft
jsonbailey wants to merge 1 commit into
Draft
Conversation
Builds on the async persistence foundation (AsyncFeatureStoreCore and AsyncCachingStoreWrapper) and adds the async-consul optional-dependency extra.
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 an async Consul persistent feature store, built on the async persistence foundation introduced in #488 (
AsyncFeatureStoreCore+AsyncCachingStoreWrapper).Consul.async_feature_store(...)returns anAsyncCachingStoreWrapperaround the new_AsyncConsulFeatureStoreCore, giving async SDK users a Consul-backed implementation ofAsyncFeatureStore. The store uses the same Consul KV layout as the synchronous Consul feature store, so an async and a synchronous SDK can share one Consul instance.Implementation notes
consul.aio.Consulclient builds its aiohttp session at construction time, which needs a running event loop. The core creates the client lazily, bound to the running event loop on the first store operation, so the factory method can still be called synchronously while building configuration. The client is released inclose().New optional dependency
async-consulextra, which pulls inpy-consul[asyncio]— the maintained Criteo fork ofpython-consulthat provides an asyncio client over aiohttp.python-consul, so the SDK temporarily depends on two Consul packages. Consolidating onto a single package is tracked separately in SDK-2913.Testing
test_async_feature_store_helpers.References
Draft pending review.