Go Worker Example
For episode 14.
go run main.go
- Remove or comment out line 108 and observe the changes in the log output.
- Remove or comment out line 108 and 112 and observe the changes in program execution.
- Think about why we do need a dedicated interruped handler?
- Add another goroutine to produce more work.
- Use a buffered job queue and print the length of
- Exit after a given timeout using another goroutine.
os.Exit(0)is not allowed, the
timepackage is your friend here.
- Use a context instead of the