app
app copied to clipboard
Graceful shutdown
Closes #67. Note that mux.Server always shutdowns gracefully and for GRPC service, we can call the GracefulStop method.
This is not enough. We need to extend the functionality and to allow developers to control what they want to process when receiving shutdown signal.
https://medium.com/honestbee-tw-engineer/gracefully-shutdown-in-go-http-server-5f5e6b83da5a
I will check it out, thank you!
The intended behavior for graceful shutdown:
- Server stops accepting new requests
- Wait for all current requests to finish
- Clean up system resources
- Shutdown the server.
Need to think about how can we make this happen.