www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - gRPC for D is released.

reply Brian <zoujiaqing gmail.com> writes:
hunt-grpc is Grpc for D programming language, hunt-http library 
based.





example server code:

   import helloworld.helloworld;
   import helloworld.helloworldrpc;
   import grpc;

   class GreeterImpl : GreeterBase
   {
       override HelloReply SayHello(HelloRequest request)
       {
           HelloReply reply = new HelloReply();
           reply.message = "hello " ~ request.name;
           return reply;
       }
   }

   string host = "0.0.0.0";
   ushort port = 50051;

   Server server = new Server();
   server.listen(host , port);
   server.register( new GreeterImpl());
   server.start();





example client code:

   import helloworld.helloworld;
   import helloworld.helloworldrpc;
   import grpc;

   auto channel = new Channel("127.0.0.1" , 50051);
   GreeterClient client = new GreeterClient(channel);

   HelloRequest request = new HelloRequest();
   request.name = "test";
   HelloReply reply = client.SayHello(request);





build for library:

dub build -v





build for example:

dub build -c=example -v




hunt-grpc project:
https://github.com/huntlabs/hunt-grpc
Oct 11 2018
next sibling parent Martin Tschierschke <mt smartdolphin.de> writes:
On Thursday, 11 October 2018 at 12:15:43 UTC, Brian wrote:
 hunt-grpc is Grpc for D programming language, hunt-http library 
 based.
[...]
 hunt-grpc project:
 https://github.com/huntlabs/hunt-grpc
Interesting! D might be a candidate for being added here later: https://grpc.io/ "go straight to Quick Start in the language of your choice:"
Oct 11 2018
prev sibling next sibling parent bachmeier <no spam.net> writes:
On Thursday, 11 October 2018 at 12:15:43 UTC, Brian wrote:
 hunt-grpc is Grpc for D programming language, hunt-http library 
 based.
 hunt-grpc project:
 https://github.com/huntlabs/hunt-grpc
Could you at least link to https://grpc.io/about/ so others know what this is?
Oct 11 2018
prev sibling parent reply April Nassi <thisisnotapril gmail.com> writes:
Hi! I'm the community manager for gRPC and this is awesome! Would 
love to add this to our ecosystem repo. Would also be great to 
have you talk about this on an upcoming community call!
Oct 11 2018
next sibling parent aberba <karabutaworld gmail.com> writes:
On Thursday, 11 October 2018 at 16:19:07 UTC, April Nassi wrote:
 Hi! I'm the community manager for gRPC and this is awesome! 
 Would love to add this to our ecosystem repo. Would also be 
 great to have you talk about this on an upcoming community call!
That'll be nice.
Oct 11 2018
prev sibling parent Brian <zoujiaqing gmail.com> writes:
On Thursday, 11 October 2018 at 16:19:07 UTC, April Nassi wrote:
 Hi! I'm the community manager for gRPC and this is awesome! 
 Would love to add this to our ecosystem repo. Would also be 
 great to have you talk about this on an upcoming community call!
Thanks, e-mail: zoujiaqing gmail.com
Oct 12 2018