On Wed, 04 Jun 2014 13:06:00 GMT, David Nadlinger wrote:

On Fri, 30 May 2014 19:38:35 GMT, Sönke Ludwig wrote:

There is also a mirror that provides a DUB package.

Last time I checked, that package unfortunately was not up to date with the latest fixes in the official repository. If/when the Dub registry gets support for adding packages with the root (dub.json) in a subdirectory, then I'd like to take over the package and make it point to the upstream (Apache) Git repository.

That would be great. The currently registered one indeed does not compile.

However, it is possible to adapt from a vibe.d Stream to a Thrift Transport quite easily both on the client and the server side. I've successfully used the following implementation in a small prototype that unfortunately hasn't made it to production yet:

https://gist.github.com/klickverbot/539deb163c6b7cf73843

There is some impedance mismatch between the two interfaces, but it's not too bad. There is also a listenThrift method that allows you to quickly create a Thrift server, very similar to listenTCP or listenHTTP.

Nice. I've started to implement it too and got something similar :-) The main difference is that I took the vibe HTTP Server code and adjusted so that a service processor object would be created per connection. I think this would be practical, if you expose an API over the public network and want to add some sort of authentication:

interface Foo { void foo(); }
class FooImpl { override void foo {} }
	
shared static this {
  auto thriftServerSettings = new VibedThriftServerSettings;
  thriftServerSettings.port = 9090;
  thriftServerSettings.bindAddresses = ["::1", "127.0.0.1"];
 
  // use default TBinaryProtocol, TBufferedTransport
  alias FooService = VibedThriftService!(Foo, FooImpl); // use default TBinaryProtocol, TBufferedTransport
 
  listenThrift!FooService(thriftServerSettings);
}

For each connection a new FooImpl processor object will be created. Maybe using a free list (or typed custom allocator) would be better.

https://gist.github.com/tavi-cacina/f9d79bbfb7897e91e9a9

I'm not experienced with D, Vibe or Thrift, so my code and templates are not so clean (yet), but I would like to help make this combo production ready

Regards,
Tavi