Add a way to resize StackFutures
まだ誰も着手していません。
評価
調査の方向性
まずリポジトリの StackFuture の実装と既存のテストを読み、その後、ストレージサイズと ownership がどのように表現されているかを追跡します。提案されている resize API を、成功パスと元の future のエラーパスを含めて評価します。完了条件は、resizing に失敗しない限り、boxing せずにより小さいまたはより大きい StackFuture を安全に試行できることです。
索引モデルが issue の本文から書いたものです。
説明
It'd be helpful to have a way to shrink (or less commonly, grow) a StackFuture. For example, sometimes you have an object that implements a trait and needs to forward calls to another object that implements the same trait. Right now that's impossible with StackFuture without boxing the child future because otherwise you'd have to have a future contain a future that's the same size as itself. That said, there will usually be some extra space so we might be able to dynamically shrink a StackFuture.
The signature would probably be something like:
fn resize<const NEW_SIZE: usize>(self) -> Result<StackFuture<T, NEW_SIZE>, Self>;
Then using this would look something like:
impl Foo for MyObject {
fn bar(&self) -> StackFuture<(), 1000> {
match self.sub_object.bar().resize::<{500}>() {
Ok(f) => f.await,
Err(original) => Box::pin(original).await,
}
}
}
The idea here is we'd try to fit the future into a smaller container, but if it doesn't fit then the resize returns the original future and we can either decide to pay the allocation cost (as we did in this example) or give up.
- 主要言語
- Rust
- スター
- 314
- フォーク
- 17
- 平均マージ
- 11時間 50分
- マージ済み PR(30日)
- 1
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/stackfuture のほかの issue
-
Add benchmarks オープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
microsoft/stackfuture#8 · リアクション 1 件 ·
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
microsoft/stackfuture#5 · コメント 1 件 · リアクション 5 件 ·
microsoft/stackfuture の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
gitbutlerapp/gitbutler#15998 · コメント 1 件 ·
-
bug triage:deciding
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
open-telemetry/otel-arrow#4132 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100