3 ms·
> I doubt anyone would switch to Java Virtual Threads anytime soon, unless via Kotlin. Switching to virtual threads will, at least in the microservices I work
by Skinney 5y ago
> I doubt anyone would switch to Java Virtual Threads anytime soon, unless via Kotlin.
Switching to virtual threads will, at least in the microservices I work with, involve changing a few lines (Executors.newUncachedThreadPool() -> Executors.newVirtualThreadPool()).
Switching to Kotlin coroutines will involve re-writing a large part of our codebase, which is why it hasn't been done.
It would surprise me if people didn't switch to Java Virtual Threads by the thousands when it comes out.
- The_rationalist 5y agoNo you can use a few lines of kotlin coroutines in an otherwise java codebase.
- Skinney 5y agoThe Java code being called, or calling, the Kotlin coroutine code also needs to be async in order to reap all the benefits. A Java codebase doing a lot of blocking calls can't just call some random Kotlin coroutine code and expect benefits, it has to be async all the way.