marilyn-rpc 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/LICENCE +18 -0
  2. data/README.md +170 -0
  3. data/doc/MarilynRPC/CallRequestMail.html +578 -0
  4. data/doc/MarilynRPC/CallResponseMail.html +418 -0
  5. data/doc/MarilynRPC/Envelope.html +705 -0
  6. data/doc/MarilynRPC/ExceptionMail.html +338 -0
  7. data/doc/MarilynRPC/Gentleman.html +658 -0
  8. data/doc/MarilynRPC/MailFactory.html +284 -0
  9. data/doc/MarilynRPC/MailHelper.html +489 -0
  10. data/doc/MarilynRPC/NativeClient.html +579 -0
  11. data/doc/MarilynRPC/NativeClientProxy.html +303 -0
  12. data/doc/MarilynRPC/Server.html +406 -0
  13. data/doc/MarilynRPC/Service.html +599 -0
  14. data/doc/MarilynRPC/ServiceCache.html +481 -0
  15. data/doc/MarilynRPC.html +108 -0
  16. data/doc/_index.html +219 -0
  17. data/doc/class_list.html +36 -0
  18. data/doc/css/common.css +1 -0
  19. data/doc/css/full_list.css +53 -0
  20. data/doc/css/style.css +318 -0
  21. data/doc/file.README.html +154 -0
  22. data/doc/file_list.html +38 -0
  23. data/doc/frames.html +13 -0
  24. data/doc/index.html +154 -0
  25. data/doc/js/app.js +203 -0
  26. data/doc/js/full_list.js +149 -0
  27. data/doc/js/jquery.js +16 -0
  28. data/doc/method_list.html +467 -0
  29. data/doc/top-level-namespace.html +88 -0
  30. data/examples/async/client.rb +40 -0
  31. data/examples/async/server.rb +26 -0
  32. data/examples/callbacks/client.rb +8 -0
  33. data/examples/callbacks/server.rb +26 -0
  34. data/examples/secure/client.rb +9 -0
  35. data/examples/secure/server.rb +22 -0
  36. data/kiss.png +0 -0
  37. data/lib/marilyn-rpc/client.rb +91 -26
  38. data/lib/marilyn-rpc/gentleman.rb +4 -1
  39. data/lib/marilyn-rpc/mails.rb +1 -1
  40. data/lib/marilyn-rpc/server.rb +27 -3
  41. data/lib/marilyn-rpc/service.rb +64 -0
  42. data/lib/marilyn-rpc/service_cache.rb +13 -2
  43. data/lib/marilyn-rpc/version.rb +1 -1
  44. metadata +39 -3
@@ -0,0 +1,467 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html>
4
+ <head>
5
+ <meta name="Content-Type" content="text/html; charset=utf-8" />
6
+ <link rel="stylesheet" href="css/full_list.css" type="text/css" media="screen" charset="utf-8" />
7
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
8
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
9
+ <script type="text/javascript" charset="utf-8" src="js/full_list.js"></script>
10
+ <base id="base_target" target="_parent" />
11
+ </head>
12
+ <body>
13
+ <script type="text/javascript" charset="utf-8">
14
+ if (window.top.frames.main) {
15
+ document.getElementById('base_target').target = 'main';
16
+ document.body.className = 'frames';
17
+ }
18
+ </script>
19
+ <div id="content">
20
+ <h1 id="full_list_header">Method List</h1>
21
+ <div id="nav">
22
+ <a target="_self" href="class_list.html">Classes</a> |
23
+ <a target="_self" href="method_list.html">Methods</a> |
24
+ <a target="_self" href="file_list.html">Files</a>
25
+ </div>
26
+ <div id="search">Search: <input type="text" /></div>
27
+
28
+ <ul id="full_list" class="methods">
29
+
30
+
31
+ <li class="r1 ">
32
+ <span class='object_link'><a href="MarilynRPC/Service.html#after_connect-class_method" title="MarilynRPC::Service.after_connect (method)">after_connect</a></span>
33
+
34
+ <small>MarilynRPC::Service</small>
35
+
36
+ </li>
37
+
38
+
39
+ <li class="r2 ">
40
+ <span class='object_link'><a href="MarilynRPC/Service.html#after_disconnect-class_method" title="MarilynRPC::Service.after_disconnect (method)">after_disconnect</a></span>
41
+
42
+ <small>MarilynRPC::Service</small>
43
+
44
+ </li>
45
+
46
+
47
+ <li class="r1 ">
48
+ <span class='object_link'><a href="MarilynRPC/CallRequestMail.html#args-instance_method" title="MarilynRPC::CallRequestMail#args (method)">#args</a></span>
49
+
50
+ <small>MarilynRPC::CallRequestMail</small>
51
+
52
+ </li>
53
+
54
+
55
+ <li class="r2 ">
56
+ <span class='object_link'><a href="MarilynRPC/MailFactory.html#build_call-class_method" title="MarilynRPC::MailFactory.build_call (method)">build_call</a></span>
57
+
58
+ <small>MarilynRPC::MailFactory</small>
59
+
60
+ </li>
61
+
62
+
63
+ <li class="r1 ">
64
+ <span class='object_link'><a href="MarilynRPC/ServiceCache.html#call-instance_method" title="MarilynRPC::ServiceCache#call (method)">#call</a></span>
65
+
66
+ <small>MarilynRPC::ServiceCache</small>
67
+
68
+ </li>
69
+
70
+
71
+ <li class="r2 ">
72
+ <span class='object_link'><a href="MarilynRPC/ServiceCache.html#call_after_disconnect_callbacks%21-instance_method" title="MarilynRPC::ServiceCache#call_after_disconnect_callbacks! (method)">#call_after_disconnect_callbacks!</a></span>
73
+
74
+ <small>MarilynRPC::ServiceCache</small>
75
+
76
+ </li>
77
+
78
+
79
+ <li class="r1 ">
80
+ <span class='object_link'><a href="MarilynRPC/Gentleman.html#callback-instance_method" title="MarilynRPC::Gentleman#callback (method)">#callback</a></span>
81
+
82
+ <small>MarilynRPC::Gentleman</small>
83
+
84
+ </li>
85
+
86
+
87
+ <li class="r2 ">
88
+ <span class='object_link'><a href="MarilynRPC/NativeClient.html#connect_tcp-class_method" title="MarilynRPC::NativeClient.connect_tcp (method)">connect_tcp</a></span>
89
+
90
+ <small>MarilynRPC::NativeClient</small>
91
+
92
+ </li>
93
+
94
+
95
+ <li class="r1 ">
96
+ <span class='object_link'><a href="MarilynRPC/NativeClient.html#connect_unix-class_method" title="MarilynRPC::NativeClient.connect_unix (method)">connect_unix</a></span>
97
+
98
+ <small>MarilynRPC::NativeClient</small>
99
+
100
+ </li>
101
+
102
+
103
+ <li class="r2 ">
104
+ <span class='object_link'><a href="MarilynRPC/Gentleman.html#connection-instance_method" title="MarilynRPC::Gentleman#connection (method)">#connection</a></span>
105
+
106
+ <small>MarilynRPC::Gentleman</small>
107
+
108
+ </li>
109
+
110
+
111
+ <li class="r1 ">
112
+ <span class='object_link'><a href="MarilynRPC/Envelope.html#content-instance_method" title="MarilynRPC::Envelope#content (method)">#content</a></span>
113
+
114
+ <small>MarilynRPC::Envelope</small>
115
+
116
+ </li>
117
+
118
+
119
+ <li class="r2 ">
120
+ <span class='object_link'><a href="MarilynRPC/Envelope.html#content%3D-instance_method" title="MarilynRPC::Envelope#content= (method)">#content=</a></span>
121
+
122
+ <small>MarilynRPC::Envelope</small>
123
+
124
+ </li>
125
+
126
+
127
+ <li class="r1 ">
128
+ <span class='object_link'><a href="MarilynRPC/CallResponseMail.html#decode-instance_method" title="MarilynRPC::CallResponseMail#decode (method)">#decode</a></span>
129
+
130
+ <small>MarilynRPC::CallResponseMail</small>
131
+
132
+ </li>
133
+
134
+
135
+ <li class="r2 ">
136
+ <span class='object_link'><a href="MarilynRPC/CallRequestMail.html#decode-instance_method" title="MarilynRPC::CallRequestMail#decode (method)">#decode</a></span>
137
+
138
+ <small>MarilynRPC::CallRequestMail</small>
139
+
140
+ </li>
141
+
142
+
143
+ <li class="r1 ">
144
+ <span class='object_link'><a href="MarilynRPC/ExceptionMail.html#decode-instance_method" title="MarilynRPC::ExceptionMail#decode (method)">#decode</a></span>
145
+
146
+ <small>MarilynRPC::ExceptionMail</small>
147
+
148
+ </li>
149
+
150
+
151
+ <li class="r2 ">
152
+ <span class='object_link'><a href="MarilynRPC/MailHelper.html#deserialize-instance_method" title="MarilynRPC::MailHelper#deserialize (method)">#deserialize</a></span>
153
+
154
+ <small>MarilynRPC::MailHelper</small>
155
+
156
+ </li>
157
+
158
+
159
+ <li class="r1 ">
160
+ <span class='object_link'><a href="MarilynRPC/NativeClient.html#disconnect-instance_method" title="MarilynRPC::NativeClient#disconnect (method)">#disconnect</a></span>
161
+
162
+ <small>MarilynRPC::NativeClient</small>
163
+
164
+ </li>
165
+
166
+
167
+ <li class="r2 ">
168
+ <span class='object_link'><a href="MarilynRPC/CallResponseMail.html#encode-instance_method" title="MarilynRPC::CallResponseMail#encode (method)">#encode</a></span>
169
+
170
+ <small>MarilynRPC::CallResponseMail</small>
171
+
172
+ </li>
173
+
174
+
175
+ <li class="r1 ">
176
+ <span class='object_link'><a href="MarilynRPC/ExceptionMail.html#encode-instance_method" title="MarilynRPC::ExceptionMail#encode (method)">#encode</a></span>
177
+
178
+ <small>MarilynRPC::ExceptionMail</small>
179
+
180
+ </li>
181
+
182
+
183
+ <li class="r2 ">
184
+ <span class='object_link'><a href="MarilynRPC/CallRequestMail.html#encode-instance_method" title="MarilynRPC::CallRequestMail#encode (method)">#encode</a></span>
185
+
186
+ <small>MarilynRPC::CallRequestMail</small>
187
+
188
+ </li>
189
+
190
+
191
+ <li class="r1 ">
192
+ <span class='object_link'><a href="MarilynRPC/Envelope.html#encode-instance_method" title="MarilynRPC::Envelope#encode (method)">#encode</a></span>
193
+
194
+ <small>MarilynRPC::Envelope</small>
195
+
196
+ </li>
197
+
198
+
199
+ <li class="r2 ">
200
+ <span class='object_link'><a href="MarilynRPC/ExceptionMail.html#exception-instance_method" title="MarilynRPC::ExceptionMail#exception (method)">#exception</a></span>
201
+
202
+ <small>MarilynRPC::ExceptionMail</small>
203
+
204
+ </li>
205
+
206
+
207
+ <li class="r1 ">
208
+ <span class='object_link'><a href="MarilynRPC/Service.html#execute_after_connect_callback%21-instance_method" title="MarilynRPC::Service#execute_after_connect_callback! (method)">#execute_after_connect_callback!</a></span>
209
+
210
+ <small>MarilynRPC::Service</small>
211
+
212
+ </li>
213
+
214
+
215
+ <li class="r2 ">
216
+ <span class='object_link'><a href="MarilynRPC/Service.html#execute_after_disconnect_callback%21-instance_method" title="MarilynRPC::Service#execute_after_disconnect_callback! (method)">#execute_after_disconnect_callback!</a></span>
217
+
218
+ <small>MarilynRPC::Service</small>
219
+
220
+ </li>
221
+
222
+
223
+ <li class="r1 ">
224
+ <span class='object_link'><a href="MarilynRPC/Envelope.html#finished%3F-instance_method" title="MarilynRPC::Envelope#finished? (method)">#finished?</a></span>
225
+
226
+ <small>MarilynRPC::Envelope</small>
227
+
228
+ </li>
229
+
230
+
231
+ <li class="r2 ">
232
+ <span class='object_link'><a href="MarilynRPC/NativeClient.html#for-instance_method" title="MarilynRPC::NativeClient#for (method)">#for</a></span>
233
+
234
+ <small>MarilynRPC::NativeClient</small>
235
+
236
+ </li>
237
+
238
+
239
+ <li class="r1 ">
240
+ <span class='object_link'><a href="MarilynRPC/Gentleman.html#handle-instance_method" title="MarilynRPC::Gentleman#handle (method)">#handle</a></span>
241
+
242
+ <small>MarilynRPC::Gentleman</small>
243
+
244
+ </li>
245
+
246
+
247
+ <li class="r2 ">
248
+ <span class='object_link'><a href="MarilynRPC/Gentleman.html#helper-instance_method" title="MarilynRPC::Gentleman#helper (method)">#helper</a></span>
249
+
250
+ <small>MarilynRPC::Gentleman</small>
251
+
252
+ </li>
253
+
254
+
255
+ <li class="r1 ">
256
+ <span class='object_link'><a href="MarilynRPC/ServiceCache.html#initialize-instance_method" title="MarilynRPC::ServiceCache#initialize (method)">#initialize</a></span>
257
+
258
+ <small>MarilynRPC::ServiceCache</small>
259
+
260
+ </li>
261
+
262
+
263
+ <li class="r2 ">
264
+ <span class='object_link'><a href="MarilynRPC/Gentleman.html#initialize-instance_method" title="MarilynRPC::Gentleman#initialize (method)">#initialize</a></span>
265
+
266
+ <small>MarilynRPC::Gentleman</small>
267
+
268
+ </li>
269
+
270
+
271
+ <li class="r1 ">
272
+ <span class='object_link'><a href="MarilynRPC/NativeClientProxy.html#initialize-instance_method" title="MarilynRPC::NativeClientProxy#initialize (method)">#initialize</a></span>
273
+
274
+ <small>MarilynRPC::NativeClientProxy</small>
275
+
276
+ </li>
277
+
278
+
279
+ <li class="r2 ">
280
+ <span class='object_link'><a href="MarilynRPC/NativeClient.html#initialize-instance_method" title="MarilynRPC::NativeClient#initialize (method)">#initialize</a></span>
281
+
282
+ <small>MarilynRPC::NativeClient</small>
283
+
284
+ </li>
285
+
286
+
287
+ <li class="r1 ">
288
+ <span class='object_link'><a href="MarilynRPC/Envelope.html#initialize-instance_method" title="MarilynRPC::Envelope#initialize (method)">#initialize</a></span>
289
+
290
+ <small>MarilynRPC::Envelope</small>
291
+
292
+ </li>
293
+
294
+
295
+ <li class="r2 ">
296
+ <span class='object_link'><a href="MarilynRPC/ServiceCache.html#lookup-instance_method" title="MarilynRPC::ServiceCache#lookup (method)">#lookup</a></span>
297
+
298
+ <small>MarilynRPC::ServiceCache</small>
299
+
300
+ </li>
301
+
302
+
303
+ <li class="r1 ">
304
+ <span class='object_link'><a href="MarilynRPC/CallRequestMail.html#method-instance_method" title="MarilynRPC::CallRequestMail#method (method)">#method</a></span>
305
+
306
+ <small>MarilynRPC::CallRequestMail</small>
307
+
308
+ </li>
309
+
310
+
311
+ <li class="r2 ">
312
+ <span class='object_link'><a href="MarilynRPC/NativeClientProxy.html#method_missing-instance_method" title="MarilynRPC::NativeClientProxy#method_missing (method)">#method_missing</a></span>
313
+
314
+ <small>MarilynRPC::NativeClientProxy</small>
315
+
316
+ </li>
317
+
318
+
319
+ <li class="r1 ">
320
+ <span class='object_link'><a href="MarilynRPC/MailHelper.html#only_data-instance_method" title="MarilynRPC::MailHelper#only_data (method)">#only_data</a></span>
321
+
322
+ <small>MarilynRPC::MailHelper</small>
323
+
324
+ </li>
325
+
326
+
327
+ <li class="r2 ">
328
+ <span class='object_link'><a href="MarilynRPC/Envelope.html#parse%21-instance_method" title="MarilynRPC::Envelope#parse! (method)">#parse!</a></span>
329
+
330
+ <small>MarilynRPC::Envelope</small>
331
+
332
+ </li>
333
+
334
+
335
+ <li class="r1 ">
336
+ <span class='object_link'><a href="MarilynRPC/CallRequestMail.html#path-instance_method" title="MarilynRPC::CallRequestMail#path (method)">#path</a></span>
337
+
338
+ <small>MarilynRPC::CallRequestMail</small>
339
+
340
+ </li>
341
+
342
+
343
+ <li class="r2 ">
344
+ <span class='object_link'><a href="MarilynRPC/Server.html#post_init-instance_method" title="MarilynRPC::Server#post_init (method)">#post_init</a></span>
345
+
346
+ <small>MarilynRPC::Server</small>
347
+
348
+ </li>
349
+
350
+
351
+ <li class="r1 ">
352
+ <span class='object_link'><a href="MarilynRPC/Gentleman.html#proxy-class_method" title="MarilynRPC::Gentleman.proxy (method)">proxy</a></span>
353
+
354
+ <small>MarilynRPC::Gentleman</small>
355
+
356
+ </li>
357
+
358
+
359
+ <li class="r2 ">
360
+ <span class='object_link'><a href="MarilynRPC/Server.html#receive_data-instance_method" title="MarilynRPC::Server#receive_data (method)">#receive_data</a></span>
361
+
362
+ <small>MarilynRPC::Server</small>
363
+
364
+ </li>
365
+
366
+
367
+ <li class="r1 ">
368
+ <span class='object_link'><a href="MarilynRPC/Service.html#register-class_method" title="MarilynRPC::Service.register (method)">register</a></span>
369
+
370
+ <small>MarilynRPC::Service</small>
371
+
372
+ </li>
373
+
374
+
375
+ <li class="r2 ">
376
+ <span class='object_link'><a href="MarilynRPC/Service.html#registry-class_method" title="MarilynRPC::Service.registry (method)">registry</a></span>
377
+
378
+ <small>MarilynRPC::Service</small>
379
+
380
+ </li>
381
+
382
+
383
+ <li class="r1 ">
384
+ <span class='object_link'><a href="MarilynRPC/CallResponseMail.html#result-instance_method" title="MarilynRPC::CallResponseMail#result (method)">#result</a></span>
385
+
386
+ <small>MarilynRPC::CallResponseMail</small>
387
+
388
+ </li>
389
+
390
+
391
+ <li class="r2 ">
392
+ <span class='object_link'><a href="MarilynRPC/Server.html#send_mail-instance_method" title="MarilynRPC::Server#send_mail (method)">#send_mail</a></span>
393
+
394
+ <small>MarilynRPC::Server</small>
395
+
396
+ </li>
397
+
398
+
399
+ <li class="r1 ">
400
+ <span class='object_link'><a href="MarilynRPC/MailHelper.html#serialize-instance_method" title="MarilynRPC::MailHelper#serialize (method)">#serialize</a></span>
401
+
402
+ <small>MarilynRPC::MailHelper</small>
403
+
404
+ </li>
405
+
406
+
407
+ <li class="r2 ">
408
+ <span class='object_link'><a href="MarilynRPC/Envelope.html#size-instance_method" title="MarilynRPC::Envelope#size (method)">#size</a></span>
409
+
410
+ <small>MarilynRPC::Envelope</small>
411
+
412
+ </li>
413
+
414
+
415
+ <li class="r1 ">
416
+ <span class='object_link'><a href="MarilynRPC/Gentleman.html#tag-instance_method" title="MarilynRPC::Gentleman#tag (method)">#tag</a></span>
417
+
418
+ <small>MarilynRPC::Gentleman</small>
419
+
420
+ </li>
421
+
422
+
423
+ <li class="r2 ">
424
+ <span class='object_link'><a href="MarilynRPC/CallRequestMail.html#tag-instance_method" title="MarilynRPC::CallRequestMail#tag (method)">#tag</a></span>
425
+
426
+ <small>MarilynRPC::CallRequestMail</small>
427
+
428
+ </li>
429
+
430
+
431
+ <li class="r1 ">
432
+ <span class='object_link'><a href="MarilynRPC/CallResponseMail.html#tag-instance_method" title="MarilynRPC::CallResponseMail#tag (method)">#tag</a></span>
433
+
434
+ <small>MarilynRPC::CallResponseMail</small>
435
+
436
+ </li>
437
+
438
+
439
+ <li class="r2 ">
440
+ <span class='object_link'><a href="MarilynRPC/MailHelper.html#type-class_method" title="MarilynRPC::MailHelper.type (method)">type</a></span>
441
+
442
+ <small>MarilynRPC::MailHelper</small>
443
+
444
+ </li>
445
+
446
+
447
+ <li class="r1 ">
448
+ <span class='object_link'><a href="MarilynRPC/Server.html#unbind-instance_method" title="MarilynRPC::Server#unbind (method)">#unbind</a></span>
449
+
450
+ <small>MarilynRPC::Server</small>
451
+
452
+ </li>
453
+
454
+
455
+ <li class="r2 ">
456
+ <span class='object_link'><a href="MarilynRPC/MailFactory.html#unpack-class_method" title="MarilynRPC::MailFactory.unpack (method)">unpack</a></span>
457
+
458
+ <small>MarilynRPC::MailFactory</small>
459
+
460
+ </li>
461
+
462
+
463
+ </ul>
464
+ </div>
465
+ </body>
466
+ </html>
467
+
@@ -0,0 +1,88 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>Top Level Namespace</title>
7
+ <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />
8
+ <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />
9
+
10
+ <script type="text/javascript" charset="utf-8">
11
+ relpath = '';
12
+ if (relpath != '') relpath += '/';
13
+ </script>
14
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
15
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
16
+
17
+ </head>
18
+ <body>
19
+ <script type="text/javascript" charset="utf-8">
20
+ if (window.top.frames.main) document.body.className = 'frames';
21
+ </script>
22
+
23
+ <div id="header">
24
+ <div id="menu">
25
+
26
+ <a href="_index.html">Index</a> &raquo;
27
+
28
+
29
+ <span class="title">Top Level Namespace</span>
30
+
31
+
32
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
33
+ </div>
34
+
35
+ <div id="search">
36
+ <a id="class_list_link" href="#">Class List</a>
37
+ <a id="method_list_link" href="#">Method List</a>
38
+ <a id ="file_list_link" href="#">File List</a>
39
+ </div>
40
+
41
+ <div class="clear"></div>
42
+ </div>
43
+
44
+ <iframe id="search_frame"></iframe>
45
+
46
+ <div id="content"><h1>Top Level Namespace
47
+
48
+
49
+
50
+ </h1>
51
+
52
+ <dl class="box">
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+ </dl>
62
+ <div class="clear"></div>
63
+
64
+ <h2>Defined Under Namespace</h2>
65
+ <p class="children">
66
+
67
+
68
+ <strong class="modules">Modules:</strong> <span class='object_link'><a href="MarilynRPC.html" title="MarilynRPC (module)">MarilynRPC</a></span>
69
+
70
+
71
+
72
+
73
+ </p>
74
+
75
+
76
+
77
+
78
+
79
+ </div>
80
+
81
+ <div id="footer">
82
+ Generated on Wed Jun 8 18:26:47 2011 by
83
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
84
+ 0.6.8 (ruby-1.8.7).
85
+ </div>
86
+
87
+ </body>
88
+ </html>
@@ -0,0 +1,40 @@
1
+ $:.push(File.join(File.dirname(__FILE__), "..", "..", "lib"))
2
+ require "marilyn-rpc"
3
+ client = MarilynRPC::NativeClient.connect_tcp('localhost', 8000)
4
+ SimpleCommandService = client.for(:cmd)
5
+
6
+ start_time = Time.now
7
+
8
+ t1 = Thread.new do
9
+ SimpleCommandService.exec("sleep 5")
10
+ puts "ls -al\n: " + SimpleCommandService.exec("ls -al")
11
+ end
12
+
13
+ t2 = Thread.new do
14
+ SimpleCommandService.exec("sleep 2")
15
+ puts "uname -a\n: " + SimpleCommandService.exec("uname -a")
16
+ end
17
+
18
+ done = false
19
+ t3 = Thread.new do
20
+ while !done
21
+ sleep 1
22
+ p client
23
+ STDOUT.print "."
24
+ STDOUT.flush
25
+ end
26
+ end
27
+
28
+ t1.join
29
+ t2.join
30
+
31
+ done = true
32
+ t3.join
33
+
34
+ p client
35
+
36
+ end_time = Time.now
37
+
38
+ puts "#{start_time - end_time}"
39
+
40
+ client.disconnect
@@ -0,0 +1,26 @@
1
+ $:.push(File.join(File.dirname(__FILE__), "..", "..", "lib"))
2
+ require "marilyn-rpc"
3
+ require "rubygems"
4
+ require "eventmachine"
5
+
6
+ class SimpleCommandService < MarilynRPC::Service
7
+ register :cmd
8
+
9
+ def exec(line)
10
+ MarilynRPC::Gentleman.proxy do |helper|
11
+ EM.system(line, &helper)
12
+
13
+ lambda do |output,status|
14
+ if (code = status.exitstatus) == 0
15
+ output
16
+ else
17
+ code
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
23
+
24
+ EM.run {
25
+ EM.start_server "localhost", 8000, MarilynRPC::Server
26
+ }
@@ -0,0 +1,8 @@
1
+ $:.push(File.join(File.dirname(__FILE__), "..", "..", "lib"))
2
+ require "marilyn-rpc"
3
+ client = MarilynRPC::NativeClient.connect_tcp('localhost', 8483)
4
+ EventsService = client.for(:events)
5
+
6
+ EventsService.notify("Hello World")
7
+
8
+ client.disconnect
@@ -0,0 +1,26 @@
1
+ $:.push(File.join(File.dirname(__FILE__), "..", "..", "lib"))
2
+ require "marilyn-rpc"
3
+ require "rubygems"
4
+ require "eventmachine"
5
+
6
+ class EventsService < MarilynRPC::Service
7
+ register :events
8
+ after_connect :connected
9
+ after_disconnect :disconnected
10
+
11
+ def connected
12
+ puts "client connected"
13
+ end
14
+
15
+ def notify(msg)
16
+ puts msg
17
+ end
18
+
19
+ def disconnected
20
+ puts "client disconnected"
21
+ end
22
+ end
23
+
24
+ EM.run {
25
+ EM.start_server "localhost", 8483, MarilynRPC::Server
26
+ }
@@ -0,0 +1,9 @@
1
+ $:.push(File.join(File.dirname(__FILE__), "..", "..", "lib"))
2
+ require "marilyn-rpc"
3
+ client = MarilynRPC::NativeClient.connect_tcp('localhost', 8008, :secure => true)
4
+ TestService = client.for(:test)
5
+
6
+ p TestService.add(1, 2)
7
+ p TestService.time.to_f
8
+
9
+ client.disconnect
@@ -0,0 +1,22 @@
1
+ $:.push(File.join(File.dirname(__FILE__), "..", "..", "lib"))
2
+ require "marilyn-rpc"
3
+ require "rubygems"
4
+ require "eventmachine"
5
+
6
+ class TestService < MarilynRPC::Service
7
+ register :test
8
+
9
+ def time
10
+ Time.now
11
+ end
12
+
13
+ def add(a, b)
14
+ a + b
15
+ end
16
+ end
17
+
18
+
19
+ EM.run {
20
+ EM.start_server "localhost", 8000, MarilynRPC::Server
21
+ EM.start_server "localhost", 8008, MarilynRPC::Server, :secure => true
22
+ }