msgpack-rpc 0.1.2

MessagePack RPC for D.


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

Manual usage
Put the following dependency into your project's dependences section:

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 <[email protected]></td>

</tr> <tr>

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

</tr> <tr>

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

</tr> </table>

Authors:
  • Masahiro Nakagawa
Dependencies:
vibe-d, msgpack-d
Versions:
0.1.3 2017-Dec-10
0.1.2 2015-Oct-06
0.1.1 2014-Dec-09
0.1.0 2014-Sep-08
~master 2019-Jan-10
Show all 6 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 3 downloads this month

  • 747 downloads total

Score:
1.5
Short URL:
msgpack-rpc.dub.pm