Grokking Concurrency in Go
0% completed
Why Go Has a Context Package
The program below compiles, passes go vet, and never crashes, yet it wastes most of the work it does. Its search function calls the course's simulated fetch three times, one after another, so a full answer takes about 300 ms. The caller waits only 150 ms before it gives up.
Output:
fetched https://example.com/a at 100ms caller gave up at 150ms fetched https://example.com/b at 200ms fetched https://example.com/c at 300ms search finished at 300ms with nobody waiting
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%