scrooge
scrooge copied to clipboard
support non-finagle servers
Its not currently possible to use scrooge with vanilla thrift.
i think specifically the request is to generate "Service" traits in the way that thrift-bin does.
I think what we need is a TProcessor that can be handed to one of the thrift servers (like THaHsServer and TThreadPoolServer).
Don't suppose anyone has built this? I'm kinda astonished that they didn't build a basic TProcessor like every other thrift compiler.
+1 for generating a TProcessor implementation.
I wrote one manually (partially generated with some custom scripts) for my service with Scrooge-generated Scala code so it certainly is possible. Still have to look at how the Scrooge code generator works though.
This works for my specific case but it's not quite generic enough yet: https://github.com/mirkonasato/scrooge/commit/7591147aa89b2f20cd64f4efde330b5be0a5ccd5
The service interface now declaring a type - as per https://github.com/twitter/scrooge/commit/cad09af7963f01a3efbb8d5a5add8e7354bda1aa - doesn't help in this respect.
Any update on this? As of the latest scrooge (3.17.0) it looks like you can only generate the server/client for finagle. Generating the TProcessor would let me use this project.
This isn't something we're working on because we mostly focus on Finagle usage. Feel free to send in patches though.
I am using a vanilla thrift generated server (F#). The only thing I had to do in order to interact with a scrooge client was using TFramedTransport instead of the default one.
type TFramedServerSocket =
inherit TServerSocket
new(port: int) = { inherit TServerSocket(port) }
new(listener: TcpListener) = { inherit TServerSocket(listener) }
override this.AcceptImpl(): TTransport =
new TFramedTransport(base.AcceptImpl()) :> TTransport
We don't have the bandwidth internally, but would be happy to look at a PR.