huntlabs / grpc-dlang

Grpc for D programming language, hunt-http library based.
Apache License 2.0
44 stars 6 forks source link

I think use return value easier to understand. #5

Closed zoujiaqing closed 5 years ago

zoujiaqing commented 5 years ago
  import helloworld.helloworld;
  import helloworld.helloworldrpc;
  import grpc;
  import std.stdio;

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

  HelloRequest request = new HelloRequest();
  request.name = "test";

  auto reply = client.SayHello(request);
  if(reply !is null)
  {
     writeln(reply.message);
  }
zhangyuchun commented 5 years ago

fixed it.