Consider adding close_connections argument to serve
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Nueva funcionalidad
- Claridad
- Necesita aclaración
- Estado de actividad
- Activo
- Stack tecnológico
- python
- Área
- api, backend, networking
Línea de trabajo
Start by comparing the asyncio, threading, and trio serve implementations with their close, shutdown, and aclose methods. Decide whether serve should gain close_connections, close_code, and close_reason or whether documentation should show the recommended pattern; done means the chosen behavior is consistently implemented or documented across all three implementations.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
The close / shutdown / aclose methods of servers (in asyncio / threading / trio implementations) take a close_connections argument to control whether the server should close connections proactively (the default behavior) or wait for clients to disconnect by themselves (which could be arbitrarily long).
When using serve as a context manager, there is no way to control this behavior. An obvious option would consist in adding a close_connections argument to serve, then proxy it to close / shutdown / aclose in __aexit__ / __exit__ / __aexit__.
If we do this, for completeness, we should also add close_code and close_reason. This means adding three arguments to serve. I'm not convinced that it's a good trade-off.
An alternative would consist in documenting the recommended pattern for controlling this behavior. Currently, the trio implementation shows an example of using aclose which can easily be extended with some parameter. The asyncio and threading implementations don't show examples of using close and shutdown.
- Lenguaje dominante
- Python
- Estrellas
- 5.7k
- Forks
- 613
- Merge medio
- 23 h 5 min
- PR fusionados (30 d)
- 9
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
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 python-websockets/websockets
-
Ping/pong frame logging can produce text that crashes non-UTF-8 log handlers (UnicodeEncodeError) Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
python-websockets/websockets#1763 · 8 comentarios ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
python-websockets/websockets#1761 · 1 comentario ·
Todos los issues de python-websockets/websockets
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
zostera/django-bootstrap4#894 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
use-agent-os/agent-os#3276 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
NousResearch/hermes-agent#117848 ·