Hacker News new | past | comments | ask | show | jobs | submit login

One consequence of reinventing the wheel (go) is going through the same problems others stumbled over years 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.


https://kotlinlang.org/docs/reference/coroutines/cancellatio...

BTW what do you think about the transition? What do you miss that was in go and would you miss in go that you find in Kotlin + the JVM library ecosystem?


Loom will have superior context cancellation and deadline handling than golang. https://cr.openjdk.java.net/~rpressler/loom/loom/sol1_part1....


I 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(..., ()->{}); ?


CompletableFuture 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: