Consider adding close_connections argument to serve
Maintainer antworten meist innerhalb von 2 Tagen
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 5/5
- Geschätzter Aufwand
- Über eine Woche
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Feature
- Klarheit
- Muss geklärt werden
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- python
- Bereich
- api, backend, networking
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- Python
- Sterne
- 5.7k
- Forks
- 621
- Ø Merge
- 1 T. 18 Std.
- Gemergte PRs (30 T.)
- 5
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Kein Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus python-websockets/websockets
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 22/100
python-websockets/websockets#1777 ·
Maintainer antworten meist innerhalb von 2 Tagen
Alle Issues in python-websockets/websockets
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
aws-samples/sample-per-model-bedrock#191 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Docs viewer: inverted grey colormap, Phantom CT window -20 to 35 HU, smoothing up to 40 mmEvtl. vergeben Ein verknüpfter Pull Request ist offen oder bereits gemergt. Offenarea: docs enhancement
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 64/100
PyTomography/PyTomography#331 ·
Maintainer antworten meist innerhalb von 1 Tag
-
effort: low prio: low ready
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
digitalfabrik/integreat-cms#4616 ·
Maintainer antworten meist innerhalb von 5 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
FuRongJun-1999/dsh-memory#226 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug difficulty:2 good first issue help wanted
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
MakazhanAlpamys/Soup#1865 ·
Maintainer antworten meist innerhalb von 1 Tag