falconry/falcon

ASGI: Add affordances and recipe for long-polling

Open

#1.808 geöffnet am 12. Dez. 2020

Auf GitHub ansehen
 (6 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Python (925 Forks)batch import
documentationenhancementgood first issueneeds contributor

Repository-Metriken

Stars
 (9.293 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 2T 7h) (9 gemergte PRs in 30 T)

Beschreibung

The 3.0 ASGI implementation already affords long-polling, but it would be useful to provide a recipe to demonstrate the pattern in the context of a Falcon app.

Also, for the sake of efficiency, we may want to provide a req.wait_disconnect() or similar method that can be executed in a background task within a responder. The responder could then use this in order to detect if it should abandon a long-poll early in the case that the client bails out. This is similar to what asgi.App does when streaming SSE's (using watch_disconnect().

Contributor Guide