From Callbacks to Promises: writing into the Future!

One amazing feature of Scala, is the possibility to link many asynchronous, Future based, functions into a beautiful stream of processing, however, if you are dealing with some maybe old Java library or struggling to maintain compatibility with legacy code, you may bump into something like this: def oldMethod(param: Int, callback: Int => Float, failure:…

How to mix Future and Either in Scala

One of greatest tools Scala offers when it comes to concurrency is the Future container. As you already know, a Future is something that will, or will not contain a value of a certain kind. The algebra of the Future implies that a it can only result in two forms: The result of the computation we…

Scroll Up