Timer Routines And Graceful Shutdowns In Go
Ardan Labs Blog on ·
In my Outcast data server I have several data retrieval jobs that run using different go routines. Each routine wakes up on a set interval. The most complex job is the downloading of radar images. What makes this complex is that there are 155 radar stations throughout the United States that take a new picture every 120 seconds. All these radar images can be put together to create a mosaic. When the go routine wakes up to pull down the new images, it must do this as quickly as possible for all 155 stations. If it doesn’t, the mosaics will be out of sync and any overlays across station boundaries will look off.