Proposal: synchronous (non-blocking) flag evaluation API alongside the async one
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
まず既存の Client::get_value/getdetails と FeatureProvider::resolve* のエントリーポイントを読み、次にプロバイダーの状態に tokio::sync::RwLock がどのように使われているかを確認します。async API を維持したまま、maintainer が sync trait、Client のアクセサー、状態戦略、cargo-feature の判断について合意すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Summary
The Rust SDK currently exposes an async-only evaluation API: every Client::get_*_value/get_*_details method and every FeatureProvider::resolve_* method is async. This proposal asks for a complementary synchronous evaluation path for providers whose resolution is purely in-memory, without removing or changing the existing async API.
Motivation
Our backend servers resolve flags from a local, periodically refreshed in-memory cache (with state polled from S3 in a background task,). For such providers, evaluation itself performs no I/O , yet the async-only API still forces us to set.await through dozens of unrelated functions, even though the underlying evaluation is a hash-map lookup.
The Java SDK also provides a sync-first API (client.getBooleanValue(...))
Spec compliance
Requirement 1.4.12
states:
The client SHOULD provide asynchronous or non-blocking mechanisms for flag evaluation.
This is a SHOULD, not a MUST.
Design sketch (for discussion)
SyncFeatureProvidertrait: same surface asFeatureProviderbut with plainfn resolve_*_value(...) -> EvaluationResult<ResolutionDetails<T>>methods. Intended for providers backed by local state (files, env vars, in-memory caches).- Sync accessors on
Client(e.g.get_bool_value_sync(...) -> EvaluationResult<bool>): available when the bound provider implementsSyncFeatureProvider; - Sync-safe internal state for the sync path: the sync accessors must not go through
tokio::sync::RwLock::blocking_*. Options include a
std::sync::RwLock/arc-swap-style snapshot for provider registration.
Open questions:
- Should this live behind a cargo feature (e.g.
sync) to keep the default dependency footprint unchanged?
If the maintainers are open to this direction, I'm happy to work on a PR implementing the agreed design.
- 主要言語
- Rust
- スター
- 53
- フォーク
- 15
- 平均マージ
- 1分
- マージ済み PR(30日)
- 16
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
open-feature/rust-sdk のほかの issue
-
Providers' `shutdown()` not invoked on `api.shutdown()`対応中かも @nicklasl が 305 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
open-feature/rust-sdk#124 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 55/100
open-feature/rust-sdk#178 ·
メンテナーはふだん 1 日以内に返信
-
Spec v0.9.0 compliance対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンv0.9.0
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
open-feature/rust-sdk#137 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
open-feature/rust-sdk#135 ·
メンテナーはふだん 1 日以内に返信
-
Building with --no-default-features is broken対応中かも @RaphaelFakhri が 22 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
open-feature/rust-sdk#114 ·
メンテナーはふだん 1 日以内に返信
open-feature/rust-sdk の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
witchesofthehill/manabrew#1309 ·
メンテナーはふだん 1 日以内に返信
-
bug help wanted ui
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
userFRM/egui-charts#4494 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
harshanandak/sidenote#304 ·
メンテナーはふだん 1 日以内に返信
-
bug P3-minor
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
eventflux-io/eventflux#268 ·
メンテナーはふだん 1 日以内に返信
-
approved enhancement frontend
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
fritzprix/libr-agent#3093 ·
メンテナーはふだん 1 日以内に返信