2 ms·
Yes, that's what I meant with context.Context (which encapsulates a cancellation channel) - but you can of course also use a plain channel. The difference is th
by Matthias247 10y ago
Yes, that's what I meant with context.Context (which encapsulates a cancellation channel) - but you can of course also use a plain channel. The difference is that Go is more explicit in this (you need a bigger amount of boilerplate code to setup cancellation and to wait for child processes to finish) and that you need to select on channels for reacting to cancellation signals instead of only relying on return values.
All in all I think you can achieve the goal with both approaches. Go favors to provide more basic building blocks whereas libdill seems to be a little bit more opinionated how your concurrency should be structured.