2 ms·
As someone who is currently transitioning from Go to Java/Kotlin I agree with you to an extent. However, I was surprised that I wasn't able to find anything in
by zkirill 6y ago
As someone who is currently transitioning from Go to Java/Kotlin I agree with you to an extent. However, I was surprised that I wasn't able to find anything in the Java/Kotlin universe that is comparable to Go's web request context cancellation.
- diek 6y agoCompletableFuture is the closest concept in Java, to my knowledge. java.util.concurrent has a ton of great classes. If you need to do shared memory concurrency, it probably has something there to help you.
- The_rationalist 6y agohttps://kotlinlang.org/docs/reference/coroutines/cancellation-and-timeouts.html https://kotlinlang.org/docs/reference/coroutines/cancellatio...
- apta 6y agoLoom will have superior context cancellation and deadline handling than golang. https://cr.openjdk.java.net/~rpressler/loom/loom/sol1_part1.html https://cr.openjdk.java.net/~rpressler/loom/loom/sol1_part1....
- Traubenfuchs 6y agoI didn't read all of it, but I was wondering: In a virtual loom thread, am I allowed to call currentThread().sleep(...); or will it block the system thread? Or is there some magic like currentThread().sleepAndThen(..., ()->{}); ?