Add a way to resize StackFutures
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
Línea de trabajo
Empieza leyendo la implementación de StackFuture y las pruebas existentes del repositorio; después, sigue cómo se representan su tamaño de almacenamiento y su ownership. Evalúa la API resize propuesta, incluidos los casos de éxito y de error del future original; se considera terminado cuando se puede intentar de forma segura con un StackFuture más pequeño o más grande sin boxing, a menos que el resizing falle.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Rust
- Estrellas
- 314
- Forks
- 17
- Merge medio
- 11 h 50 min
- PR fusionados (30 d)
- 1
Guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de microsoft/stackfuture
-
Add benchmarks Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
microsoft/stackfuture#8 · 1 reacción ·
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
microsoft/stackfuture#5 · 1 comentario · 5 reacciones ·
Todos los issues de microsoft/stackfuture
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
gitbutlerapp/gitbutler#15998 · 1 comentario ·
-
bug triage:deciding
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
open-telemetry/otel-arrow#4132 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100