emmett-framework / granian

A Rust HTTP server for Python applications
BSD 3-Clause "New" or "Revised" License
2.67k stars 79 forks source link

Add `__rsgi_del__` support to RSGI spec #322

Closed 2-5 closed 2 months ago

2-5 commented 3 months ago

Currently there is no easy way to gracefully shutdown the app when the worker exits.

As a real world use case, I need to register the web-server app with another system so that requests will be routed to it on start (__rsgi_init__), and I need to de-register it on exit. If it's not de-registered, there will be failed requests.