This is where I think Scala really, really shines, regardless of whether you're using Akka or not. Once you've gotten into that mode of using futures, turning your code from blocking to nonblocking is as simple as never writing that Await statement, but having your methods return a Future[MyClass] instead of MyClass.
The funny thing is that writing nonblocking code doesn't have to be as hard as it is, you just have to get into the mindset. It's easy to say "well, I have to have the result coming back from my JDBC/REST/etc call before I know what to do with it" and that's not the case at all, especially when you're working in a strongly-typed environment.
The funny thing is that writing nonblocking code doesn't have to be as hard as it is, you just have to get into the mindset. It's easy to say "well, I have to have the result coming back from my JDBC/REST/etc call before I know what to do with it" and that's not the case at all, especially when you're working in a strongly-typed environment.