facebook/nifty — pull request #55 by andrewcox (2013-05-06 22:24:40+00:00)
Title: Nifty fbcode refactor

This is a different take on cleaning up the relationship between nifty and nifty-fbcode.

1) makes the frame codec a configurable part of the server via ThriftServerDef
2) changes the server def to use duplex protocol factories, so that protocols which require that inputprotocol==outputprotocol (e.g. header protocol) can provide a factory to enforce this instead of having the nifty-fbcode version of dispatcher special-case this
3) uses NiftyProcessor instead of thrift's TProcessor, and uses adapters to adapt the standard thrift TProcess to a NiftyProcessor (and nifty-fbcode will adapt a fbcode thrift TProcessor to a NiftyProcessor with a few differences)...

The NiftyProcessor and adapter classes also opens things up to adding more functionality to NiftyProcessor that swift can take advantage of while still working with a version of nifty that supports standard thrift (e.g. a processor that returns a future, with an adapter for standard thrift processors that just gets the result synchronously and returns an immediate future).

With this diff I'll be able to delete the duplicate versions of NettyServerTransport, NiftyBootstrap and NiftyDispatcher in nifty-fbcode, and use the same version of each of these as standard nifty does.