Consider automatic incoming entity collection to simplify API (discuss)
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
Línea de trabajo
Comienza examinando las APIs públicas de HttpEntity.Strict y HttpEntity.Default y el comportamiento descrito en #460. Compara la conversión automática a strict, la documentación y el ocultamiento de los detalles internos del streaming, prestando especial atención a los límites fijos, el dispatch diferido y la migración al streaming. Done no está definido en el issue; un colaborador tendría que tomar primero una decisión de diseño y acordar el alcance.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
One of the oldest issues with akka-http/pekko-http is the distinction between HttpEntity.Strict and HttpEntity.Default that cannot be observed on the wire but leads to different API behavior for the user just based on the timing with which data is received.
Strict contains an in-memory copy of the full data, while Default contains a live stream that is still connected to the connection.
The rationale for this API is that we want to supply a streaming API whenever it makes sense to 1. provide data to the user in real time as it comes in and 2. to avoid having to load all data into memory but have all the nice properties of streams like end-to-end backpressure and limited memory usage.
The backside is that while the current solution gives you all the options to deal with a real time situation optimally, it also requires you to deal with all these cases (or use toStrict in more cases).
However, this often trips up users (like in #460) where depending on the environment the exact same request can lead to different runtime behavior. Often, when running tests locally, it is much more likely that requests end up as Strict while in production, Default becomes more likely. In situations like #460, the effect can be really subtle and hard to understand.
One potential solution could be to auto-strictify incoming entities for simplicity. In that case, we would always read incoming entities to their completion (up to a fixed limit) and delay dispatching the incoming HTTP message until the full message is there. The benefit would be that users of simple applications would get every message with a strict entity.
The downside is that I can see no gradual migration path once you need streaming behavior for certain entities. Then you would still have to enable streaming for the whole application which then might not be expecting streaming entities...
Alternatives:
- (even) better documentation to educate about the way things work
- try to remove Strict from the public API (very intrusive and subtle issues like #460 will not be solved that way)
- improve library to mitigate impact / hide internals of the streaming API further
(I have not convinced myself yet that we can or should change something right now without making other cases worse but still wanted to keep a note here)
- Lenguaje dominante
- Scala
- Estrellas
- 196
- Forks
- 56
- Merge medio
- 1 d 18 h
- PR fusionados (30 d)
- 43
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la 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 apache/pekko-http
-
dependencies
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
apache/pekko-http#1354 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 45/100
apache/pekko-http#1273 ·
Los mantenedores suelen responder en 1 día
-
HTTP/2 client ALPN fallback needs a handshake-complete signal that the TLS stage does not emitAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
apache/pekko-http#1249 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
apache/pekko-http#1248 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 42/100
apache/pekko-http#1180 ·
Los mantenedores suelen responder en 1 día
Todos los issues de apache/pekko-http
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 1/5 1-3 horas Aptitud para principiantes 83/100
apache/datafusion-comet#7101 ·
Los mantenedores suelen responder en 1 día
-
scope:security type:aquasec
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
AbsaOSS/atum-service#494 ·