Description

MessagePack RPC for D.

Package Information

Version0.1.2 (2015-Oct-06)
Homepage https://github.com/msgpack-rpc/msgpack-rpc-d
Repository https://github.com/msgpack-rpc/msgpack-rpc-d
LicenseBoost Software License, Version 1.0
CopyrightCopyright (c) 2013- Masahiro Nakagawa
AuthorsMasahiro Nakagawa
Registered byMasahiro Nakagawa
Dependencies

vibe-d

msgpack-d

Installation

To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

Readme

MessagePack RPC for D

MessagePack RPC implementation based on vibe.d

Example

Client

auto client = new TCPClient(Endpoint(18800, "127.0.0.1"));

// sync request
auto num = client.call!ulong("sum", 1, 2);

// async request: return a Future object
auto future = client.callAsync("sum", 1, 2);

// notify
client.notify("hello", "hoge");

Server

Object

class FooServer
{
    ulong sum(ulong l, ulong r)
    {
        return l + r;
    }

    void hello(string msg)
    {   
        writeln(msg);
    }
}

// TCPServer or UDPServer
auto server = new TCPServer!(FooServer)(new FooServer);
server.listen(Endpoint(18800, "127.0.0.1"));
server.start();

module

module foo;

ulong sum(ulong l, ulong r)
{
    return l + r;
}

void hello(string msg)
{   
    writeln(msg);
}

auto server = new TCPServer!(foo)();
// same as Object

MessagePack official site

Github repository

<table> <tr>

<td>Author</td><td>Masahiro Nakagawa <repeatedly@gmail.com></td>

</tr> <tr>

<td>Copyright</td><td>Copyright (c) 2013- Masahiro Nakagawa</td>

</tr> <tr>

<td>License</td><td>MIT License</td>

</tr> </table>

Available versions

0.1.2 0.1.1 0.1.0 ~master ~fix-32bit-build