I might have misunderstood something but I wonder if the go-routine inside the method is really cancelled? You see, if you put a infinite loop after the ”doWorldDomination” call in the main loop, the go-routine still performs its work.
Most applications live longer and using this method would mean that goroutines arent actually cancelled.
Putting "Context" into context
Ollie, regarding the example below:
https://play.golang.org/p/Dt6fzcHF-go
I might have misunderstood something but I wonder if the go-routine inside the method is really cancelled? You see, if you put a infinite loop after the ”doWorldDomination” call in the main loop, the go-routine still performs its work.
Most applications live longer and using this method would mean that goroutines arent actually cancelled.
Ollie: Great article!
I think the section on 'Chaining Context' can be developed and explained more clearly along 2 main points:
1. A parent context will always impact all its descendent child contexts
2. A child context will always impact all its descendent child contexts but not its parent or ancestor contexts
In that sense, I think the Context behaves like traditional inheritance in OOP.