4 ms·
Scala makes it really easy to call a blocking function using a future with a configurable execution context. I don't see why one would run out of threads. Curre
by justinhj 10y ago
Scala makes it really easy to call a blocking function using a future with a configurable execution context. I don't see why one would run out of threads. Currently we use the Typesafe supported Slick library but the mechanism is the same.
Maybe I'm missing your point but as a professional Scala programmer I've never run into a problem with Jvm or Java integration
- phamilton 10y agoI've done it naively with a mongo driver. Just wrapping it in a future doesn't cut it, as you said you have to configure a separate execution context and even that context is finite. Or use a blocking future which has other implications. It's more a point against the "strictly better than Java, use the bits you want as you you go" point in the article. You have to understand Scala's execution model and make sure you are mixing the paradigms properly, because it's fully of leaky abstractions.
- twblalock 10y agoIt's also a real pain to call Scala code from Java, which makes blending Java and Scala code in a project, or adding Scala code to an existing Java project, much less attractive.