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
hunt-grpc is Grpc for D programming language, hunt-http library
based.
- gRPC for D is released. Brian via Digitalmars-d-announce
- Re: gRPC for D is rele... Martin Tschierschke via Digitalmars-d-announce
- Re: gRPC for D is rele... bachmeier via Digitalmars-d-announce
- Re: gRPC for D is rele... April Nassi via Digitalmars-d-announce
- Re: gRPC for D is ... aberba via Digitalmars-d-announce
- Re: gRPC for D is ... Brian via Digitalmars-d-announce
