guardian/open-platform-content-api-scala-client — pull request #13 by bmjames (2013-03-11 15:40:35+00:00)
Title: Asynchronous Content API client

(N.B. I won't merge this until I've had some discussion with Mobile Aggregator developers, and possibly some testing by them of the 1.22-SNAPSHOT artifact.)

This patch endows the Content API Scala client with an asynchronous API as well as the existing blocking API.

The API is intended to remain completely compatible with existing users of the (blocking) client implementations from previous releases.

For async usage, the library natively supports returning results in a Dispatch `Promise`, by using the `DispatchAsyncApi` instance.

Support for `scala.concurrent.Future` is also possible - but currently requires some external glue code (to a `Future`-supporting HTTP client of the user's choice). I've made (but not included here) a proof-of-concept implementation using Play framework's WS client. This could be included in the library if there is a desire for it, and if it can be done nicely without pulling in the whole of Play as a dependency.