Add a way to resize StackFutures
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 35/100
Direção de pesquisa
Comece lendo a implementação de StackFuture e os testes existentes do repositório; em seguida, trace como o tamanho do armazenamento e o ownership são representados. Avalie a API resize proposta, incluindo os caminhos de sucesso e de erro do future original; considera-se concluído quando for possível tentar com segurança usar um StackFuture menor ou maior sem boxing, a menos que o resizing falhe.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Rust
- Estrelas
- 314
- Forks
- 17
- Merge médio
- 11h 50min
- PRs com merge (30d)
- 1
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de microsoft/stackfuture
-
Add benchmarks Aberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
microsoft/stackfuture#8 · 1 reação ·
-
enhancement
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
microsoft/stackfuture#5 · 1 comentário · 5 reações ·
Todas as issues de microsoft/stackfuture
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug team:backend track:services-maintenance
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
cowprotocol/services#4950 ·
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
gitbutlerapp/gitbutler#15998 · 1 comentário ·
-
bug triage:deciding
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
open-telemetry/otel-arrow#4132 ·