scrooge icon indicating copy to clipboard operation
scrooge copied to clipboard

support non-finagle servers

Open ryanking opened this issue 13 years ago • 9 comments

Its not currently possible to use scrooge with vanilla thrift.

ryanking avatar Apr 05 '12 01:04 ryanking

i think specifically the request is to generate "Service" traits in the way that thrift-bin does.

robey avatar Apr 10 '12 23:04 robey

I think what we need is a TProcessor that can be handed to one of the thrift servers (like THaHsServer and TThreadPoolServer).

ryanking avatar Apr 11 '12 19:04 ryanking

Don't suppose anyone has built this? I'm kinda astonished that they didn't build a basic TProcessor like every other thrift compiler.

madsmith avatar Jun 27 '13 11:06 madsmith

+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.

mirkonasato avatar Aug 23 '13 10:08 mirkonasato

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.

mirkonasato avatar Sep 09 '13 19:09 mirkonasato

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.

dcapwell avatar Nov 09 '14 00:11 dcapwell

This isn't something we're working on because we mostly focus on Finagle usage. Feel free to send in patches though.

nshkrob avatar Nov 11 '14 00:11 nshkrob

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

JanBessai avatar Sep 01 '15 16:09 JanBessai

We don't have the bandwidth internally, but would be happy to look at a PR.

mosesn avatar May 29 '16 17:05 mosesn