twitter/scrooge — pull request #158 by m50d (2014-11-07 15:58:25+00:00)
Title: Scala TProcessor implementations for Some and Async

Based on mirkonasato's branch, but I haven't received any reply from them.

Provides synchronous processors for services typed on `Some` (scalaz `Id` would be more correct but would introduce a dependency on scalaz at all times), and (when invoked with --scalaz) asynchronous processors for services typed on scalaz's `Task` (depending on https://github.com/apache/thrift/pull/253 for better async support in thrift ). These will depend on a little more at runtime; rather than make scrooge-core depend on scalaz I've created a scrooge-scalaz subproject that depends on scalaz, and the classes generated with --scalaz depend on this.

(Motivation: implementing a server without using Finagle - in particular because my server code needs to be scala 2.11. Also I like the scalaz `Task` abstraction.)

Arguably we should provide a processor that's generic in the same way as the interface is, but that's slightly beyond my current abilities. At the least, the distinction between sync and async seems pretty fundamental and hard to abstract over.

This is probably not an implementation that should be merged as-is - the code is not as abstracted as it should be, nor as well-tested, and support for oneway functions may be entirely missing. I'm submitting this as a pull request more to open a dialogue and check I'm moving in the right direction. Any advice about the design, or what kind of tests are necessary, would be very much appreciated.