-
-
Notifications
You must be signed in to change notification settings - Fork 144
Description
Is your feature request related to a problem? Please describe.
This is slightly related to #105
In a request handler I drop the layer2 connection (wifi on esp32).
That leaves the webbrowser hanging, eventually timing out.
Describe the solution you'd like
In my little world, a decorator alike after_request
would solve the issue, but after sending out the response - let's name it afterafter_request
.
So, a request handler could respond and complete the HTTP request (e.g. by sending 200/OK), and then disconnect from wifi.
Describe alternatives you've considered
Initially I figured the after_request
-decorator would maybe do what I want. But its decorated function is being called before the HTTP client is being responded to.
Also, e.g.:
try:
print("OOO", "Responding to client")
return "OK!"
finally:
print("OOO", "Disconnecting from wifi")
wifi.disconnect()
does not appear to send the response before disconnecting from wifi, despite the print()
statements being executed in the correct order.