Category: REST

Asynchronous programming with Async / Await and the Scala Play Framework

Asynchronous programming has a number of advantages, most notably is its well touted ability to improve responsiveness. Asynchronous events occur independently of the main program flow and asynchronous actions are executed in a non-blocking, lock-free manner. This, ultimately, allows the main program flow to continue unimpeded, without blocking. On the flips side, asynchronous programming can be difficult to reason about. Many actions are often run simultaneously which can lead to complex semantics and...

Play Framework – Adapting Java 8 CompletableFutures to Play F.Promises

Recently, I have been playing around with Java 8 and the Play Framework (2.4RC1) – bad pun intended :P. As I worked to develop the codebase, I found the need to integrate with Java 8 CompletableFuture‘s. No big deal, right? At first, it didn’t seem to be, but as I continued coding, I quickly became very unhappy with how my code was turning out. The Play Framework for Java introduces...

How to use the Play WS library in a standalone Scala app

The Play WS library makes it possible to execute HTTP requests and process the response asynchronously. It provides an awesome API that is incredibly easy to use. (I’ve provided a few simple WS examples toward the end of this post.) Prior to the release of Play 2.4 (the current 2.4 release is the M2 milestone release), it was possible to utilize the WS API in a standalone Play app, however...

REST example with PlayFramework Scala

Scala is an incredible language!! It is ridiculously concise and is packed full of wonderful features that combine to provide a pure functional and pure oo language. Currently, I am working on two Scala Play2 projects and I couldn’t be happier. In this post, we will build a super simple REST service using Play and Scala. Once again, we’ll go with the Cars theme! Prerequisites: – Download and Install the Typesafe Activator –...

Create a natural language question answering system with IBM Watson on Bluemix

See my latest blog post on developerWorks. The topic is how to ‘Create a natural language question answering system with IBM Watson on Bluemix’.  I co-wrote the article with Swami Chandrasekaran. It is incredibly cool stuff. I hope you enjoy!   Here is a brief intro to wet your appetite: Cognition is in virtually everything that humans do, such as language understanding, perception, judgment, motor skills, learning, spatial processing and social behavior. Increasingly,...