Well the timeout can be handled in java too
Result result = future.get(5, TimeUnit.Second);
if (result == null)
// do something if timed out
else
// do something with result
My original question was phrased badly though, and what I meant to ask was: is the underlying implementation faster? Since Golang is designed as a systems language, is the channel/gorouting system a lot more performant than the Executor/future method of Java?
EDIT: I see what newobj is talking about now:
With the Java method, the 'task queue' in this case is very rigid and would be hard to add futures from multiple locations, while the goroutine method allows easy access to add new messages to the channel from anywhere.
You could probably emulate the goroutine method using a synchronized queue or similar, but the goroutine version handles it automatically.