Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 41 lines (26 sloc) 0.932 kB
066382d @tobi Added readme
authored
1 == MessagePipe
2
3 MessagePack (http://msgpack.org/) based high performance rpc layer with support for multiple transports (eventually)
4
5 == Example
6
7
8 server.rb:
9
10 class TestServer < MessagePipeServer
11
12 def add(a, b)
13 a + b
14 end
15
16 def echo(string)
17 string
18 end
19
20 end
21
22 EventMachine::run do
23 EventMachine::start_server "0.0.0.0", 9191, TestServer
24 end
25
26
27
28 client.rb
29
30 client = MessagePipe.new(TcpTransport.new('localhost', 9191))
31 client.call :add, 1, 2 #=> 3
32 client.call :echo, 'hello' #=> 'hello'
33 client.call :does_not_exist #=> raise MessagePipe::RemoteError, 'NoMethodError: no method with name does_not_exist'
34
35 == todo
36
37 * improve file structure
38 * implement EM based client transport
39 * implement redis based client transport with delivery guarantees
7324b54 @tobi todo added
authored
40 * allow calls to be async if transport supports it (will require you to call result.get to get the actual payload)
41 * support timeouts and reconnects
Something went wrong with that request. Please try again.