grpc 0.3.0-beta.4

gRPC implementation for D programming language

To use this package, run the following command in your project's root directory:

Build Status


gRPC implementation for D.


Building the protocol buffer compiler for D

$ dub build :protoc-gen-d
$ sudo cp build/protoc-gen-d /usr/local/bin

Building the gRPC plugin for D

$ git submodule update --init --recursive
# Update Git submodule to latest commit on origin
# git submodule update --remote --merge
$ cd compiler
$ mkdir build
$ cd build
$ cmake ..
$ make -j4
$ sudo cp deps/protobuf/protoc* /usr/local/bin
$ sudo cp grpc_dlang_plugin /usr/local/bin

Building the core library

cd grpc-dlang
dub build

Generating protobuf code

protoc --plugin=/usr/local/bin/protoc-gen-d --d_out=./examples -I ./examples ./examples/helloworld.proto

Generating grpc client and server code

protoc --plugin=protoc-gen-grpc=/usr/local/bin/grpc_dlang_plugin -I ./examples --grpc_out=./examples ./examples/helloworld.proto

Building the examples

  1. A simple demo
dub build -c=example
  1. Demo for streaming
dub build -c=streamexample
./streamexample -f ./examples/route_guide_db.json


The server

import grpc;

import helloworld.helloworld;
import helloworld.helloworldrpc;

class GreeterImpl : GreeterBase
    override Status SayHello(HelloRequest request , ref HelloReply reply)
        reply.message = "hello " ~;
        return Status.OK;

string host = "";
ushort port = 50051;

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

The client

import helloworld.helloworld;
import helloworld.helloworldrpc;
import grpc;
import std.stdio;

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

auto request = new HelloRequest(); = "test";

HelloReply reply = client.SayHello(request);
if(reply !is null)

The streaming

We implemented the offical example RouteGuide


protobuf, hunt-http
0.3.0-beta.4 2020-Oct-02
0.3.0-beta.3 2020-Jul-15
0.3.0-beta.2 2019-Oct-06
0.3.0-beta.1 2019-Sep-18
0.2.0 2019-Mar-12
Show all 6 versions
Download Stats:
  • 0 downloads today

  • 3 downloads this week

  • 21 downloads this month

  • 116 downloads total

Short URL: