Implementing Graceful Shutdown in Go & NodeJS
Complex applications or services usually start a number of internal workers that process data more efficiently. If the service is stopped or restarted those workers need to finish handling each in-flight message before they are stopped to avoid data loss or rework.