Are there any differences between a Go channel and a Java BlockingQueue? Both are queues with similar blocking and memory model semantics. Optionally both can have a capacity se
One more very important difference is: You can close a Go channel to signal that no more elements are coming. That is not possible using Java.
Example: goroutine A reads a list of files. It posts each file into the Channel. After the last file, it closes the channel. goroutine B reads the files from the channel and processes them in some way. After the channel is closed, the goroutine quits.
Doing this in Java is not easily possible; however some workarounds exist.