I have written a small web application using actix-web. As part of starting the application I'm taking a resource and passing it in as part of the app_data
for the HttpServer App.
I want to clean up the resource when the application exits (through SIGTERM or SIGINT). The clean-up needs to call an async function, so I cannot do the clean-up by implementing Drop
.
Is there a way to add a hook/handler to actix_web, that runs as part of the shutdown?