Managing long-running processes

A goroutine is typically created so that code flow continues while another task completes in the background. If these tasks start to be used for application-critical tasks or to handle important data, especially if these tasks could take a long time, we need to manage them more carefully. The main consideration is how to shut down background tasks gracefully if the application exits. This may not seem essential, and for some tasks it may not be, but if the process is involved in data integrity, we want to be certain that early termination doesn't cause problems.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.151.44