Graceful Server—Wait and Shutdown

Learn how to wait and listen after starting the server. Also, learn how to gracefully shut it down by listening to kill signals.

Wait while listening

Our core problem so far is that our main thread is exiting, causing our server to die. To prevent that, we will use a channel. We will keep listening on it, therefore ensuring our main thread doesn’t quit.

Get hands-on with 1200+ tech skills courses.