www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - good RPC framework for D?

reply Timothee Cour via Digitalmars-d <digitalmars-d puremagic.com> writes:
Is there a good RPC framework for D?

requirements:
* efficient (no json/xml)
* supports at least sending/receiving raw bytes

I tried msgpack-rpc but it seems abandonned (last commit 2 y ago) and
this issue makes it unusable:
https://github.com/msgpack-rpc/msgpack-rpc-d/issues/16 for messages of
length >= 4090 bytes.

I would love to have a GRPC work with D but couldn't find a package for it.

Is there at least a reliable solution that sends raw bytes ? than I
can for eg wrap protobufs or other serialized formats via
serialization/deserialization.

Additional requirements: supports streaming data (either input or
output or both), and timeouts.
Jun 05
next sibling parent Neia Neutuladh <neia ikeran.org> writes:
On Tuesday, 6 June 2017 at 01:01:34 UTC, Timothee Cour wrote:
 Is there a good RPC framework for D?
Last time I needed one, I used Thrift. D support in Thrift is maintained upstream. Unfortunately, the version available in dub is really old. Also unfortunately, it's std.socket only -- no vibe.d. https://thrift.apache.org/docs/features https://github.com/apache/thrift/tree/master/lib/d
 requirements:
 * efficient (no json/xml)
Thrift uses a binary format relatively similar to protocol buffers.
 * supports at least sending/receiving raw bytes
Thrift supports a `binary` data type representing a byte array.
 Additional requirements: supports streaming data (either input 
 or output or both)
I'm not sure what you mean by "streaming data", precisely, but Thrift supports multiple RPCs per connection. This alone made a huge difference in my testing: a Thrift server on an AWS t2.micro managed 2400 requests per second across ten clients, while HTTP handlers returning a fixed string only managed 75.
 and timeouts.
Definitely supports timeouts.
Jun 05
prev sibling next sibling parent Laeeth Isharc <Laeeth kaleidic.io> writes:
On Tuesday, 6 June 2017 at 01:01:34 UTC, Timothee Cour wrote:
 Is there a good RPC framework for D?

 requirements:
 * efficient (no json/xml)
 * supports at least sending/receiving raw bytes

 I tried msgpack-rpc but it seems abandonned (last commit 2 y 
 ago) and this issue makes it unusable: 
 https://github.com/msgpack-rpc/msgpack-rpc-d/issues/16 for 
 messages of length >= 4090 bytes.

 I would love to have a GRPC work with D but couldn't find a 
 package for it.

 Is there at least a reliable solution that sends raw bytes ? 
 than I can for eg wrap protobufs or other serialized formats 
 via serialization/deserialization.

 Additional requirements: supports streaming data (either input 
 or
 output or both), and timeouts.
I am working right now on wrapping grpc, but it's a bit of work and I have lots of other things to do and can't be sure when or if I will finish. The C API is not that bad once you understand what if is doing. And see dprotobuf.
Jun 05
prev sibling parent Ola Fosheim =?UTF-8?B?R3LDuHN0YWQ=?= writes:
On Tuesday, 6 June 2017 at 01:01:34 UTC, Timothee Cour wrote:
 Is there at least a reliable solution that sends raw bytes ? 
 than I can for eg wrap protobufs or other serialized formats 
 via serialization/deserialization.

 Additional requirements: supports streaming data (either input 
 or
 output or both), and timeouts.
Sounds like you want to use a raw TCP/IP connection...
Jun 06