5 ms·
I assume `Go` would have to be Closeable and you'd still need the try-with-resources, right?
by insanitybit 3y ago
I assume `Go` would have to be Closeable and you'd still need the try-with-resources, right?
- kaba0 3y agoYou don't need a try-with-resources, you can manually call close if you want, or has to work in a non-lexical scope. But you often want the concurrently running threads to return some results, that try-with-resources is part of the structured concurrency that helps you with closing off a branching point, similarly to how we use while loops instead of gotos. `go` in itself corresponds to `goto` basically, with many of the same negatives.
- ivan_gammel 3y agoMaybe you re-read my comment, check the signature of Go::go() and think again?