3 ms·
> If everything is treated as async, you will need to await everything In go you work rather differently. You let tasks go off and do their thing, and provide
by shellac 4y ago
> If everything is treated as async, you will need to await everything
In go you work rather differently. You let tasks go off and do their thing, and provide a channel to communicate. Pulling a response from the channel is the 'await'. A good part of go's magic is that these tasks - goroutines - don't result in large amount of blocked threads.
Java will soon have the building blocks of something rather similar to goroutines.
- pca006132 4y agoOK I see, but I think these two approaches address different problems? The approach used by go is more powerful than async but also more verbose. The implementation is also different, async can be implemented with a generator but goroutine can't.