Comment

Comment by noelwelsh

Scala's futures are wonderful to use. There are two main benefits:

1. They compose, meaning you can construct a Future out of other Futures

2. They work with Scala's for comprehension syntax making them very concise to use.

We use them everywhere in Myna. The one downside with plain futures is it's very easy to forget to handle errors, so we typically have a Future of a Validation. In Scala 2.10 you'd probably use Try in preference. I talk more about futures and our error handling strategy here: http://noelwelsh.com/blueeyes/concurrency.html

Finally, if you use Node.js and think callbacks are the cat's pyjamas you really should check out a futures implementation (not necessarily in Scala). They are a much better abstraction.

parent noelwelsh 14 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton