marilyn-rpc 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. data/README.md +39 -4
  2. data/examples/async/client.rb +0 -5
  3. data/examples/authentication/client.rb +18 -0
  4. data/examples/authentication/server.rb +30 -0
  5. data/lib/marilyn-rpc.rb +1 -1
  6. data/lib/marilyn-rpc/client.rb +21 -3
  7. data/lib/marilyn-rpc/error.rb +13 -0
  8. data/lib/marilyn-rpc/mails.rb +3 -3
  9. data/lib/marilyn-rpc/server.rb +6 -11
  10. data/lib/marilyn-rpc/service.rb +86 -11
  11. data/lib/marilyn-rpc/service_cache.rb +44 -23
  12. data/lib/marilyn-rpc/version.rb +1 -1
  13. data/spec/mails_spec.rb +2 -1
  14. data/spec/server_spec.rb +1 -1
  15. data/spec/service_cache_spec.rb +140 -0
  16. data/spec/service_spec.rb +56 -5
  17. data/spec/spec_helper.rb +5 -0
  18. metadata +10 -34
  19. data/doc/MarilynRPC.html +0 -108
  20. data/doc/MarilynRPC/CallRequestMail.html +0 -578
  21. data/doc/MarilynRPC/CallResponseMail.html +0 -418
  22. data/doc/MarilynRPC/Envelope.html +0 -705
  23. data/doc/MarilynRPC/ExceptionMail.html +0 -338
  24. data/doc/MarilynRPC/Gentleman.html +0 -658
  25. data/doc/MarilynRPC/MailFactory.html +0 -284
  26. data/doc/MarilynRPC/MailHelper.html +0 -489
  27. data/doc/MarilynRPC/NativeClient.html +0 -579
  28. data/doc/MarilynRPC/NativeClientProxy.html +0 -303
  29. data/doc/MarilynRPC/Server.html +0 -406
  30. data/doc/MarilynRPC/Service.html +0 -599
  31. data/doc/MarilynRPC/ServiceCache.html +0 -481
  32. data/doc/_index.html +0 -219
  33. data/doc/class_list.html +0 -36
  34. data/doc/css/common.css +0 -1
  35. data/doc/css/full_list.css +0 -53
  36. data/doc/css/style.css +0 -318
  37. data/doc/file.README.html +0 -154
  38. data/doc/file_list.html +0 -38
  39. data/doc/frames.html +0 -13
  40. data/doc/index.html +0 -154
  41. data/doc/js/app.js +0 -203
  42. data/doc/js/full_list.js +0 -149
  43. data/doc/js/jquery.js +0 -16
  44. data/doc/method_list.html +0 -467
  45. data/doc/top-level-namespace.html +0 -88
  46. data/spec/service_cache.rb +0 -45
@@ -1,579 +0,0 @@
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>Class: MarilynRPC::NativeClient</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 (N)</a> &raquo;
27
- <span class='title'><span class='object_link'><a href="../MarilynRPC.html" title="MarilynRPC (module)">MarilynRPC</a></span></span>
28
- &raquo;
29
- <span class="title">NativeClient</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>Class: MarilynRPC::NativeClient
47
-
48
-
49
-
50
- </h1>
51
-
52
- <dl class="box">
53
-
54
- <dt class="r1">Inherits:</dt>
55
- <dd class="r1">
56
- <span class="inheritName">Object</span>
57
-
58
- <ul class="fullTree">
59
- <li>Object</li>
60
-
61
- <li class="next">MarilynRPC::NativeClient</li>
62
-
63
- </ul>
64
- <a href="#" class="inheritanceTree">show all</a>
65
-
66
- </dd>
67
-
68
-
69
-
70
-
71
-
72
-
73
-
74
-
75
-
76
- <dt class="r2 last">Defined in:</dt>
77
- <dd class="r2 last">lib/marilyn-rpc/client.rb</dd>
78
-
79
- </dl>
80
- <div class="clear"></div>
81
-
82
- <h2>Overview</h2><div class="docstring">
83
- <div class="discussion">
84
- <p>The client that will handle the socket to the remote. The native client is written in pure ruby.</p>
85
-
86
- </div>
87
- </div>
88
- <div class="tags">
89
-
90
- <div class="examples">
91
- <h3>Examples:</h3>
92
-
93
- <h4><div class='inline'><p>Using the native client</p></div></h4>
94
- <pre class="example code"><span class='require identifier id'>require</span> <span class='string val'>&quot;marilyn-rpc&quot;</span>
95
- <span class='client identifier id'>client</span> <span class='assign token'>=</span> <span class='MarilynRPC constant id'>MarilynRPC</span><span class='colon2 op'>::</span><span class='NativeClient constant id'>NativeClient</span><span class='dot token'>.</span><span class='connect_tcp identifier id'>connect_tcp</span><span class='lparen token'>(</span><span class='string val'>'localhost'</span><span class='comma token'>,</span> <span class='integer val'>8483</span><span class='rparen token'>)</span>
96
- <span class='TestService constant id'>TestService</span> <span class='assign token'>=</span> <span class='client identifier id'>client</span><span class='dot token'>.</span><span class='for identifier id'>for</span><span class='lparen token'>(</span><span class='symbol val'>:test</span><span class='rparen token'>)</span>
97
- <span class='TestService constant id'>TestService</span><span class='dot token'>.</span><span class='add identifier id'>add</span><span class='lparen token'>(</span><span class='integer val'>1</span><span class='comma token'>,</span> <span class='integer val'>2</span><span class='rparen token'>)</span>
98
- <span class='TestService constant id'>TestService</span><span class='dot token'>.</span><span class='time identifier id'>time</span><span class='dot token'>.</span><span class='to_f identifier id'>to_f</span>
99
- </pre>
100
-
101
- </div>
102
-
103
- </div>
104
-
105
-
106
-
107
- <h2>
108
- Class Method Summary
109
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
110
- </h2>
111
-
112
- <ul class="summary">
113
-
114
- <li class="public ">
115
- <span class="summary_signature">
116
-
117
- <a href="#connect_tcp-class_method" title="connect_tcp (class method)">+ (MarilynRPC::NativeClient) <strong>connect_tcp</strong>(host, port) </a>
118
-
119
-
120
-
121
- </span>
122
-
123
-
124
-
125
-
126
-
127
-
128
-
129
-
130
- <span class="summary_desc"><div class='inline'><p>Connect to a tcp socket.</p></div></span>
131
-
132
- </li>
133
-
134
-
135
- <li class="public ">
136
- <span class="summary_signature">
137
-
138
- <a href="#connect_unix-class_method" title="connect_unix (class method)">+ (MarilynRPC::NativeClient) <strong>connect_unix</strong>(path) </a>
139
-
140
-
141
-
142
- </span>
143
-
144
-
145
-
146
-
147
-
148
-
149
-
150
-
151
- <span class="summary_desc"><div class='inline'><p>Connect to a unix domain socket.</p></div></span>
152
-
153
- </li>
154
-
155
-
156
- </ul>
157
-
158
- <h2>
159
- Instance Method Summary
160
- <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
161
- </h2>
162
-
163
- <ul class="summary">
164
-
165
- <li class="public ">
166
- <span class="summary_signature">
167
-
168
- <a href="#disconnect-instance_method" title="#disconnect (instance method)">- (Object) <strong>disconnect</strong> </a>
169
-
170
-
171
-
172
- </span>
173
-
174
-
175
-
176
-
177
-
178
-
179
-
180
-
181
- <span class="summary_desc"><div class='inline'><p>Disconnect the client from the remote.</p></div></span>
182
-
183
- </li>
184
-
185
-
186
- <li class="public ">
187
- <span class="summary_signature">
188
-
189
- <a href="#for-instance_method" title="#for (instance method)">- (MarilynRPC::NativeClientProxy) <strong>for</strong>(path) </a>
190
-
191
-
192
-
193
- </span>
194
-
195
-
196
-
197
-
198
-
199
-
200
-
201
-
202
- <span class="summary_desc"><div class='inline'><p>Creates a new Proxy Object for the connection.</p></div></span>
203
-
204
- </li>
205
-
206
-
207
- <li class="public ">
208
- <span class="summary_signature">
209
-
210
- <a href="#initialize-instance_method" title="#initialize (instance method)">- (NativeClient) <strong>initialize</strong>(socket) </a>
211
-
212
-
213
-
214
- </span>
215
-
216
- <span class="note title constructor">constructor</span>
217
-
218
-
219
-
220
-
221
-
222
-
223
-
224
-
225
- <span class="summary_desc"><div class='inline'><p>Create a native client for the socket.</p></div></span>
226
-
227
- </li>
228
-
229
-
230
- </ul>
231
-
232
-
233
- <div id="constructor_details" class="method_details_list">
234
- <h2>Constructor Details</h2>
235
-
236
- <div class="method_details first">
237
- <p class="signature first" id="initialize-instance_method">
238
-
239
- - (<tt><span class='object_link'><a href="" title="MarilynRPC::NativeClient (class)">NativeClient</a></span></tt>) <strong>initialize</strong>(socket)
240
-
241
-
242
-
243
- </p><div class="docstring">
244
- <div class="discussion">
245
- <p>Create a native client for the socket.</p>
246
-
247
- </div>
248
- </div>
249
- <div class="tags">
250
- <h3>Parameters:</h3>
251
- <ul class="param">
252
-
253
- <li>
254
-
255
- <span class='type'>(<tt>Socket</tt>)</span>
256
-
257
-
258
- <span class='name'>socket</span>
259
-
260
-
261
-
262
- &mdash;
263
- <div class='inline'><p>the socket to manage</p></div>
264
-
265
- </li>
266
-
267
- </ul>
268
-
269
- </div><table class="source_code">
270
- <tr>
271
- <td>
272
- <pre class="lines">
273
-
274
-
275
- 48
276
- 49
277
- 50</pre>
278
- </td>
279
- <td>
280
- <pre class="code"><span class="info file"># File 'lib/marilyn-rpc/client.rb', line 48</span>
281
-
282
- <span class='def def kw'>def</span> <span class='initialize identifier id'>initialize</span><span class='lparen token'>(</span><span class='socket identifier id'>socket</span><span class='rparen token'>)</span>
283
- <span class='@socket ivar id'>@socket</span> <span class='assign token'>=</span> <span class='socket identifier id'>socket</span>
284
- <span class='end end kw'>end</span>
285
- </pre>
286
- </td>
287
- </tr>
288
- </table>
289
- </div>
290
-
291
- </div>
292
-
293
-
294
- <div id="class_method_details" class="method_details_list">
295
- <h2>Class Method Details</h2>
296
-
297
-
298
- <div class="method_details first">
299
- <p class="signature first" id="connect_tcp-class_method">
300
-
301
- + (<tt><span class='object_link'><a href="" title="MarilynRPC::NativeClient (class)">MarilynRPC::NativeClient</a></span></tt>) <strong>connect_tcp</strong>(host, port)
302
-
303
-
304
-
305
- </p><div class="docstring">
306
- <div class="discussion">
307
- <p>Connect to a tcp socket.</p>
308
-
309
- </div>
310
- </div>
311
- <div class="tags">
312
- <h3>Parameters:</h3>
313
- <ul class="param">
314
-
315
- <li>
316
-
317
- <span class='type'>(<tt>String</tt>)</span>
318
-
319
-
320
- <span class='name'>host</span>
321
-
322
-
323
-
324
- &mdash;
325
- <div class='inline'><p>the host to cennect to (e.g. &#8216;localhost&#8217;)</p></div>
326
-
327
- </li>
328
-
329
- <li>
330
-
331
- <span class='type'>(<tt>Integer</tt>)</span>
332
-
333
-
334
- <span class='name'>port</span>
335
-
336
-
337
-
338
- &mdash;
339
- <div class='inline'><p>the port to connect to (e.g. 8000)</p></div>
340
-
341
- </li>
342
-
343
- </ul>
344
- <h3>Returns:</h3>
345
- <ul class="return">
346
-
347
- <li>
348
-
349
- <span class='type'>(<tt><span class='object_link'><a href="" title="MarilynRPC::NativeClient (class)">MarilynRPC::NativeClient</a></span></tt>)</span>
350
-
351
-
352
-
353
-
354
- &mdash;
355
- <div class='inline'><p>the cónnected client</p></div>
356
-
357
- </li>
358
-
359
- </ul>
360
-
361
- </div><table class="source_code">
362
- <tr>
363
- <td>
364
- <pre class="lines">
365
-
366
-
367
- 77
368
- 78
369
- 79</pre>
370
- </td>
371
- <td>
372
- <pre class="code"><span class="info file"># File 'lib/marilyn-rpc/client.rb', line 77</span>
373
-
374
- <span class='def def kw'>def</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='connect_tcp identifier id'>connect_tcp</span><span class='lparen token'>(</span><span class='host identifier id'>host</span><span class='comma token'>,</span> <span class='port identifier id'>port</span><span class='rparen token'>)</span>
375
- <span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='TCPSocket constant id'>TCPSocket</span><span class='dot token'>.</span><span class='open identifier id'>open</span><span class='lparen token'>(</span><span class='host identifier id'>host</span><span class='comma token'>,</span> <span class='port identifier id'>port</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
376
- <span class='end end kw'>end</span>
377
- </pre>
378
- </td>
379
- </tr>
380
- </table>
381
- </div>
382
-
383
- <div class="method_details ">
384
- <p class="signature " id="connect_unix-class_method">
385
-
386
- + (<tt><span class='object_link'><a href="" title="MarilynRPC::NativeClient (class)">MarilynRPC::NativeClient</a></span></tt>) <strong>connect_unix</strong>(path)
387
-
388
-
389
-
390
- </p><div class="docstring">
391
- <div class="discussion">
392
- <p>Connect to a unix domain socket.</p>
393
-
394
- </div>
395
- </div>
396
- <div class="tags">
397
- <h3>Parameters:</h3>
398
- <ul class="param">
399
-
400
- <li>
401
-
402
- <span class='type'>(<tt>String</tt>)</span>
403
-
404
-
405
- <span class='name'>path</span>
406
-
407
-
408
-
409
- &mdash;
410
- <div class='inline'><p>the path to the socket file.</p></div>
411
-
412
- </li>
413
-
414
- </ul>
415
- <h3>Returns:</h3>
416
- <ul class="return">
417
-
418
- <li>
419
-
420
- <span class='type'>(<tt><span class='object_link'><a href="" title="MarilynRPC::NativeClient (class)">MarilynRPC::NativeClient</a></span></tt>)</span>
421
-
422
-
423
-
424
-
425
- &mdash;
426
- <div class='inline'><p>the cónnected client</p></div>
427
-
428
- </li>
429
-
430
- </ul>
431
-
432
- </div><table class="source_code">
433
- <tr>
434
- <td>
435
- <pre class="lines">
436
-
437
-
438
- 69
439
- 70
440
- 71</pre>
441
- </td>
442
- <td>
443
- <pre class="code"><span class="info file"># File 'lib/marilyn-rpc/client.rb', line 69</span>
444
-
445
- <span class='def def kw'>def</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='connect_unix identifier id'>connect_unix</span><span class='lparen token'>(</span><span class='path identifier id'>path</span><span class='rparen token'>)</span>
446
- <span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='UNIXSocket constant id'>UNIXSocket</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='path identifier id'>path</span><span class='rparen token'>)</span><span class='rparen token'>)</span>
447
- <span class='end end kw'>end</span>
448
- </pre>
449
- </td>
450
- </tr>
451
- </table>
452
- </div>
453
-
454
- </div>
455
-
456
- <div id="instance_method_details" class="method_details_list">
457
- <h2>Instance Method Details</h2>
458
-
459
-
460
- <div class="method_details first">
461
- <p class="signature first" id="disconnect-instance_method">
462
-
463
- - (<tt>Object</tt>) <strong>disconnect</strong>
464
-
465
-
466
-
467
- </p><div class="docstring">
468
- <div class="discussion">
469
- <p>Disconnect the client from the remote.</p>
470
-
471
- </div>
472
- </div>
473
- <div class="tags">
474
-
475
- </div><table class="source_code">
476
- <tr>
477
- <td>
478
- <pre class="lines">
479
-
480
-
481
- 53
482
- 54
483
- 55</pre>
484
- </td>
485
- <td>
486
- <pre class="code"><span class="info file"># File 'lib/marilyn-rpc/client.rb', line 53</span>
487
-
488
- <span class='def def kw'>def</span> <span class='disconnect identifier id'>disconnect</span>
489
- <span class='@socket ivar id'>@socket</span><span class='dot token'>.</span><span class='close identifier id'>close</span>
490
- <span class='end end kw'>end</span>
491
- </pre>
492
- </td>
493
- </tr>
494
- </table>
495
- </div>
496
-
497
- <div class="method_details ">
498
- <p class="signature " id="for-instance_method">
499
-
500
- - (<tt><span class='object_link'><a href="NativeClientProxy.html" title="MarilynRPC::NativeClientProxy (class)">MarilynRPC::NativeClientProxy</a></span></tt>) <strong>for</strong>(path)
501
-
502
-
503
-
504
- </p><div class="docstring">
505
- <div class="discussion">
506
- <p>Creates a new Proxy Object for the connection.</p>
507
-
508
- </div>
509
- </div>
510
- <div class="tags">
511
- <h3>Parameters:</h3>
512
- <ul class="param">
513
-
514
- <li>
515
-
516
- <span class='type'>(<tt>Object</tt>)</span>
517
-
518
-
519
- <span class='name'>path</span>
520
-
521
-
522
-
523
- &mdash;
524
- <div class='inline'><p>the path were the service is registered on the remote site</p></div>
525
-
526
- </li>
527
-
528
- </ul>
529
- <h3>Returns:</h3>
530
- <ul class="return">
531
-
532
- <li>
533
-
534
- <span class='type'>(<tt><span class='object_link'><a href="NativeClientProxy.html" title="MarilynRPC::NativeClientProxy (class)">MarilynRPC::NativeClientProxy</a></span></tt>)</span>
535
-
536
-
537
-
538
-
539
- &mdash;
540
- <div class='inline'><p>the proxy obejct that will serve all calls</p></div>
541
-
542
- </li>
543
-
544
- </ul>
545
-
546
- </div><table class="source_code">
547
- <tr>
548
- <td>
549
- <pre class="lines">
550
-
551
-
552
- 62
553
- 63
554
- 64</pre>
555
- </td>
556
- <td>
557
- <pre class="code"><span class="info file"># File 'lib/marilyn-rpc/client.rb', line 62</span>
558
-
559
- <span class='def def kw'>def</span> <span class='for for kw'>for</span><span class='lparen token'>(</span><span class='path identifier id'>path</span><span class='rparen token'>)</span>
560
- <span class='NativeClientProxy constant id'>NativeClientProxy</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='path identifier id'>path</span><span class='comma token'>,</span> <span class='@socket ivar id'>@socket</span><span class='rparen token'>)</span>
561
- <span class='end end kw'>end</span>
562
- </pre>
563
- </td>
564
- </tr>
565
- </table>
566
- </div>
567
-
568
- </div>
569
-
570
- </div>
571
-
572
- <div id="footer">
573
- Generated on Wed Jun 8 18:26:46 2011 by
574
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
575
- 0.6.8 (ruby-1.8.7).
576
- </div>
577
-
578
- </body>
579
- </html>