swift-server / swift-server/async-http-client
Accept any EventLoops in `.delegate(on:)`, not just ones from AHC's own ELG
Nadie ha tomado este issue todavía.
- Lenguaje dominante
- Swift
- Estrellas
- 1.1k
- Forks
- 156
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
The badly named but highly useful .delegate(on:) specifies two things:
- Which
EventLoopthe returned futures are bound to - Which
EventLoopthe delegate callouts happen on.
Crucially it does not specify on what EventLoop the underlying Channels are running on. Yes, as an optimisation if possible & sensible (i.e. the connection pool doesn't already have a valid connection) we try to create new Channels on the same EventLoop but that's neither guaranteed nor required.
Expected behaviour
If I pass a random EventLoop to AHC's eventLoop: .delegate(on: myRandomEL) then I would expect this to work, even if AHC itself is using an EventLoopGroup that doesn't contain my EventLoop for its Channels.
Actual behaviour
AHC crashes and tells me that I can only use EventLoops from AHC's EventLoopGroup at runtime. That's bad an unnecessary.
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.
Línea de trabajo
Comienza en el punto de entrada .delegate(on:) y sigue la validación en tiempo de ejecución que restringe el EventLoop proporcionado al propio EventLoopGroup de AHC. Añade cobertura usando un EventLoop de un grupo separado y verifica después que la delegación funciona sin un crash, mientras los Channels subyacentes siguen estando gobernados por AHC.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- swift
- Área
- networking
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100