marilyn-rpc 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (44) hide show
  1. data/benchmark/client.rb +42 -14
  2. data/doc/MarilynRPC.html +108 -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/_index.html +219 -0
  16. data/doc/class_list.html +36 -0
  17. data/doc/css/common.css +1 -0
  18. data/doc/css/full_list.css +53 -0
  19. data/doc/css/style.css +318 -0
  20. data/doc/file.README.html +154 -0
  21. data/doc/file_list.html +38 -0
  22. data/doc/frames.html +13 -0
  23. data/doc/index.html +154 -0
  24. data/doc/js/app.js +203 -0
  25. data/doc/js/full_list.js +149 -0
  26. data/doc/js/jquery.js +16 -0
  27. data/doc/method_list.html +467 -0
  28. data/doc/top-level-namespace.html +88 -0
  29. data/lib/marilyn-rpc/client.rb +20 -21
  30. data/lib/marilyn-rpc/envelope.rb +27 -10
  31. data/lib/marilyn-rpc/gentleman.rb +8 -1
  32. data/lib/marilyn-rpc/mails.rb +40 -55
  33. data/lib/marilyn-rpc/server.rb +4 -11
  34. data/lib/marilyn-rpc/service.rb +1 -1
  35. data/lib/marilyn-rpc/service_cache.rb +7 -4
  36. data/lib/marilyn-rpc/version.rb +1 -1
  37. data/marilyn-rpc-0.0.2.gem +0 -0
  38. data/spec/envelope_spec.rb +18 -9
  39. data/spec/gentleman_spec.rb +14 -3
  40. data/spec/mails_spec.rb +2 -1
  41. data/spec/server_spec.rb +4 -4
  42. data/spec/service_cache_spec.rb +8 -0
  43. data/spec/spec_helper.rb +9 -2
  44. metadata +30 -22
@@ -0,0 +1,599 @@
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::Service</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 (S)</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">Service</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::Service
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::Service</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/service.rb</dd>
78
+
79
+ </dl>
80
+ <div class="clear"></div>
81
+
82
+ <h2>Overview</h2><div class="docstring">
83
+ <div class="discussion">
84
+ <p>This class represents the base for all events, it is used for registering services and defining callbacks for certain service events.</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>a service that makes use of the available helpers</p></div></h4>
94
+ <pre class="example code"><span class='class class kw'>class</span> <span class='EventsService constant id'>EventsService</span> <span class='lt op'>&lt;</span> <span class='MarilynRPC constant id'>MarilynRPC</span><span class='colon2 op'>::</span><span class='Service constant id'>Service</span>
95
+ <span class='register identifier id'>register</span> <span class='symbol val'>:events</span>
96
+ <span class='after_connect identifier id'>after_connect</span> <span class='symbol val'>:connected</span>
97
+ <span class='after_disconnect identifier id'>after_disconnect</span> <span class='symbol val'>:disconnected</span>
98
+
99
+ <span class='def def kw'>def</span> <span class='connected identifier id'>connected</span>
100
+ <span class='puts identifier id'>puts</span> <span class='string val'>&quot;client connected&quot;</span>
101
+ <span class='end end kw'>end</span>
102
+
103
+ <span class='def def kw'>def</span> <span class='notify identifier id'>notify</span><span class='lparen token'>(</span><span class='msg identifier id'>msg</span><span class='rparen token'>)</span>
104
+ <span class='puts identifier id'>puts</span> <span class='msg identifier id'>msg</span>
105
+ <span class='end end kw'>end</span>
106
+
107
+ <span class='def def kw'>def</span> <span class='disconnected identifier id'>disconnected</span>
108
+ <span class='puts identifier id'>puts</span> <span class='string val'>&quot;client disconnected&quot;</span>
109
+ <span class='end end kw'>end</span>
110
+ <span class='end end kw'>end</span>
111
+ </pre>
112
+
113
+ </div>
114
+
115
+ </div>
116
+
117
+
118
+
119
+ <h2>
120
+ Class Method Summary
121
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
122
+ </h2>
123
+
124
+ <ul class="summary">
125
+
126
+ <li class="public ">
127
+ <span class="summary_signature">
128
+
129
+ <a href="#after_connect-class_method" title="after_connect (class method)">+ (Object) <strong>after_connect</strong>(*callbacks) </a>
130
+
131
+
132
+
133
+ </span>
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+ <span class="summary_desc"><div class='inline'><p>register one or more connect callbacks.</p></div></span>
143
+
144
+ </li>
145
+
146
+
147
+ <li class="public ">
148
+ <span class="summary_signature">
149
+
150
+ <a href="#after_disconnect-class_method" title="after_disconnect (class method)">+ (Object) <strong>after_disconnect</strong>(*callbacks) </a>
151
+
152
+
153
+
154
+ </span>
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+ <span class="summary_desc"><div class='inline'><p>register one or more disconnect callbacks.</p></div></span>
164
+
165
+ </li>
166
+
167
+
168
+ <li class="public ">
169
+ <span class="summary_signature">
170
+
171
+ <a href="#register-class_method" title="register (class method)">+ (Object) <strong>register</strong>(path) </a>
172
+
173
+
174
+
175
+ </span>
176
+
177
+
178
+
179
+
180
+
181
+
182
+
183
+
184
+ <span class="summary_desc"><div class='inline'><p>registers the class where is was called as a service.</p></div></span>
185
+
186
+ </li>
187
+
188
+
189
+ <li class="public ">
190
+ <span class="summary_signature">
191
+
192
+ <a href="#registry-class_method" title="registry (class method)">+ (Hash&lt;String, Object&gt;) <strong>registry</strong> </a>
193
+
194
+
195
+
196
+ </span>
197
+
198
+
199
+
200
+
201
+
202
+ <span class="private note title">Private</span>
203
+
204
+
205
+ <span class="summary_desc"><div class='inline'><p>returns all services, that where registered.</p></div></span>
206
+
207
+ </li>
208
+
209
+
210
+ </ul>
211
+
212
+ <h2>
213
+ Instance Method Summary
214
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
215
+ </h2>
216
+
217
+ <ul class="summary">
218
+
219
+ <li class="public ">
220
+ <span class="summary_signature">
221
+
222
+ <a href="#execute_after_connect_callback%21-instance_method" title="#execute_after_connect_callback! (instance method)">- (Object) <strong>execute_after_connect_callback!</strong> </a>
223
+
224
+
225
+
226
+ </span>
227
+
228
+
229
+
230
+
231
+
232
+ <span class="private note title">Private</span>
233
+
234
+
235
+ <span class="summary_desc"><div class='inline'><p>calls the defined connect callbacks.</p></div></span>
236
+
237
+ </li>
238
+
239
+
240
+ <li class="public ">
241
+ <span class="summary_signature">
242
+
243
+ <a href="#execute_after_disconnect_callback%21-instance_method" title="#execute_after_disconnect_callback! (instance method)">- (Object) <strong>execute_after_disconnect_callback!</strong> </a>
244
+
245
+
246
+
247
+ </span>
248
+
249
+
250
+
251
+
252
+
253
+ <span class="private note title">Private</span>
254
+
255
+
256
+ <span class="summary_desc"><div class='inline'><p>calls the defined diconnect callbacks.</p></div></span>
257
+
258
+ </li>
259
+
260
+
261
+ </ul>
262
+
263
+
264
+
265
+
266
+ <div id="class_method_details" class="method_details_list">
267
+ <h2>Class Method Details</h2>
268
+
269
+
270
+ <div class="method_details first">
271
+ <p class="signature first" id="after_connect-class_method">
272
+
273
+ + (<tt>Object</tt>) <strong>after_connect</strong>(*callbacks)
274
+
275
+
276
+
277
+ </p><div class="docstring">
278
+ <div class="discussion">
279
+ <p>register one or more connect callbacks</p>
280
+
281
+ </div>
282
+ </div>
283
+ <div class="tags">
284
+ <h3>Parameters:</h3>
285
+ <ul class="param">
286
+
287
+ <li>
288
+
289
+ <span class='type'>(<tt>Array&lt;Symbol&gt;</tt>, <tt>Array&lt;String&gt;</tt>)</span>
290
+
291
+
292
+ <span class='name'>callbacks</span>
293
+
294
+
295
+
296
+ </li>
297
+
298
+ </ul>
299
+
300
+ </div><table class="source_code">
301
+ <tr>
302
+ <td>
303
+ <pre class="lines">
304
+
305
+
306
+ 40
307
+ 41
308
+ 42
309
+ 43</pre>
310
+ </td>
311
+ <td>
312
+ <pre class="code"><span class="info file"># File 'lib/marilyn-rpc/service.rb', line 40</span>
313
+
314
+ <span class='def def kw'>def</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='after_connect identifier id'>after_connect</span><span class='lparen token'>(</span><span class='mult op'>*</span><span class='callbacks identifier id'>callbacks</span><span class='rparen token'>)</span>
315
+ <span class='@@_after_connect_callbacks ivar id'>@@_after_connect_callbacks</span> <span class='opasgn op'>||=</span> <span class='lbrack token'>[</span><span class='rbrack token'>]</span>
316
+ <span class='@@_after_connect_callbacks ivar id'>@@_after_connect_callbacks</span> <span class='opasgn op'>+=</span> <span class='callbacks identifier id'>callbacks</span>
317
+ <span class='end end kw'>end</span>
318
+ </pre>
319
+ </td>
320
+ </tr>
321
+ </table>
322
+ </div>
323
+
324
+ <div class="method_details ">
325
+ <p class="signature " id="after_disconnect-class_method">
326
+
327
+ + (<tt>Object</tt>) <strong>after_disconnect</strong>(*callbacks)
328
+
329
+
330
+
331
+ </p><div class="docstring">
332
+ <div class="discussion">
333
+ <p>register one or more disconnect callbacks</p>
334
+
335
+ </div>
336
+ </div>
337
+ <div class="tags">
338
+ <h3>Parameters:</h3>
339
+ <ul class="param">
340
+
341
+ <li>
342
+
343
+ <span class='type'>(<tt>Array&lt;Symbol&gt;</tt>, <tt>Array&lt;String&gt;</tt>)</span>
344
+
345
+
346
+ <span class='name'>callbacks</span>
347
+
348
+
349
+
350
+ </li>
351
+
352
+ </ul>
353
+
354
+ </div><table class="source_code">
355
+ <tr>
356
+ <td>
357
+ <pre class="lines">
358
+
359
+
360
+ 47
361
+ 48
362
+ 49
363
+ 50</pre>
364
+ </td>
365
+ <td>
366
+ <pre class="code"><span class="info file"># File 'lib/marilyn-rpc/service.rb', line 47</span>
367
+
368
+ <span class='def def kw'>def</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='after_disconnect identifier id'>after_disconnect</span><span class='lparen token'>(</span><span class='mult op'>*</span><span class='callbacks identifier id'>callbacks</span><span class='rparen token'>)</span>
369
+ <span class='@@_after_disconnect_callbacks ivar id'>@@_after_disconnect_callbacks</span> <span class='opasgn op'>||=</span> <span class='lbrack token'>[</span><span class='rbrack token'>]</span>
370
+ <span class='@@_after_disconnect_callbacks ivar id'>@@_after_disconnect_callbacks</span> <span class='opasgn op'>+=</span> <span class='callbacks identifier id'>callbacks</span>
371
+ <span class='end end kw'>end</span>
372
+ </pre>
373
+ </td>
374
+ </tr>
375
+ </table>
376
+ </div>
377
+
378
+ <div class="method_details ">
379
+ <p class="signature " id="register-class_method">
380
+
381
+ + (<tt>Object</tt>) <strong>register</strong>(path)
382
+
383
+
384
+
385
+ </p><div class="docstring">
386
+ <div class="discussion">
387
+ <p>registers the class where is was called as a service</p>
388
+
389
+ </div>
390
+ </div>
391
+ <div class="tags">
392
+ <h3>Parameters:</h3>
393
+ <ul class="param">
394
+
395
+ <li>
396
+
397
+ <span class='type'>(<tt>String</tt>)</span>
398
+
399
+
400
+ <span class='name'>path</span>
401
+
402
+
403
+
404
+ &mdash;
405
+ <div class='inline'><p>the path of the service</p></div>
406
+
407
+ </li>
408
+
409
+ </ul>
410
+
411
+ </div><table class="source_code">
412
+ <tr>
413
+ <td>
414
+ <pre class="lines">
415
+
416
+
417
+ 25
418
+ 26
419
+ 27
420
+ 28</pre>
421
+ </td>
422
+ <td>
423
+ <pre class="code"><span class="info file"># File 'lib/marilyn-rpc/service.rb', line 25</span>
424
+
425
+ <span class='def def kw'>def</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='register identifier id'>register</span><span class='lparen token'>(</span><span class='path identifier id'>path</span><span class='rparen token'>)</span>
426
+ <span class='@@registry ivar id'>@@registry</span> <span class='opasgn op'>||=</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span>
427
+ <span class='@@registry ivar id'>@@registry</span><span class='lbrack token'>[</span><span class='path identifier id'>path</span><span class='rbrack token'>]</span> <span class='assign token'>=</span> <span class='self self kw'>self</span>
428
+ <span class='end end kw'>end</span>
429
+ </pre>
430
+ </td>
431
+ </tr>
432
+ </table>
433
+ </div>
434
+
435
+ <div class="method_details ">
436
+ <p class="signature " id="registry-class_method">
437
+
438
+ + (<tt>Hash&lt;String, Object&gt;</tt>) <strong>registry</strong>
439
+
440
+
441
+
442
+ </p><div class="docstring">
443
+ <div class="discussion">
444
+ <p class="note private">
445
+ <strong>This method is part of a private API.</strong>
446
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
447
+ </p>
448
+ <p>returns all services, that where registered</p>
449
+
450
+ </div>
451
+ </div>
452
+ <div class="tags">
453
+ <h3>Returns:</h3>
454
+ <ul class="return">
455
+
456
+ <li>
457
+
458
+ <span class='type'>(<tt>Hash&lt;String, Object&gt;</tt>)</span>
459
+
460
+
461
+
462
+
463
+ &mdash;
464
+ <div class='inline'><p>all registered services with path as key and the registered service as object</p></div>
465
+
466
+ </li>
467
+
468
+ </ul>
469
+
470
+ </div><table class="source_code">
471
+ <tr>
472
+ <td>
473
+ <pre class="lines">
474
+
475
+
476
+ 34
477
+ 35
478
+ 36</pre>
479
+ </td>
480
+ <td>
481
+ <pre class="code"><span class="info file"># File 'lib/marilyn-rpc/service.rb', line 34</span>
482
+
483
+ <span class='def def kw'>def</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='registry identifier id'>registry</span>
484
+ <span class='@@registry ivar id'>@@registry</span> <span class='orop op'>||</span> <span class='lbrace token'>{</span><span class='rbrace token'>}</span>
485
+ <span class='end end kw'>end</span>
486
+ </pre>
487
+ </td>
488
+ </tr>
489
+ </table>
490
+ </div>
491
+
492
+ </div>
493
+
494
+ <div id="instance_method_details" class="method_details_list">
495
+ <h2>Instance Method Details</h2>
496
+
497
+
498
+ <div class="method_details first">
499
+ <p class="signature first" id="execute_after_connect_callback!-instance_method">
500
+
501
+ - (<tt>Object</tt>) <strong>execute_after_connect_callback!</strong>
502
+
503
+
504
+
505
+ </p><div class="docstring">
506
+ <div class="discussion">
507
+ <p class="note private">
508
+ <strong>This method is part of a private API.</strong>
509
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
510
+ </p>
511
+ <p>calls the defined connect callbacks</p>
512
+
513
+ </div>
514
+ </div>
515
+ <div class="tags">
516
+
517
+ </div><table class="source_code">
518
+ <tr>
519
+ <td>
520
+ <pre class="lines">
521
+
522
+
523
+ 54
524
+ 55
525
+ 56
526
+ 57
527
+ 58</pre>
528
+ </td>
529
+ <td>
530
+ <pre class="code"><span class="info file"># File 'lib/marilyn-rpc/service.rb', line 54</span>
531
+
532
+ <span class='def def kw'>def</span> <span class='execute_after_connect_callback! fid id'>execute_after_connect_callback!</span>
533
+ <span class='lparen token'>(</span><span class='@@_after_connect_callbacks ivar id'>@@_after_connect_callbacks</span> <span class='orop op'>||</span> <span class='lbrack token'>[</span><span class='rbrack token'>]</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='callback identifier id'>callback</span><span class='bitor op'>|</span>
534
+ <span class='self self kw'>self</span><span class='dot token'>.</span><span class='send identifier id'>send</span><span class='lparen token'>(</span><span class='callback identifier id'>callback</span><span class='rparen token'>)</span>
535
+ <span class='end end kw'>end</span>
536
+ <span class='end end kw'>end</span>
537
+ </pre>
538
+ </td>
539
+ </tr>
540
+ </table>
541
+ </div>
542
+
543
+ <div class="method_details ">
544
+ <p class="signature " id="execute_after_disconnect_callback!-instance_method">
545
+
546
+ - (<tt>Object</tt>) <strong>execute_after_disconnect_callback!</strong>
547
+
548
+
549
+
550
+ </p><div class="docstring">
551
+ <div class="discussion">
552
+ <p class="note private">
553
+ <strong>This method is part of a private API.</strong>
554
+ You should avoid using this method if possible, as it may be removed or be changed in the future.
555
+ </p>
556
+ <p>calls the defined diconnect callbacks</p>
557
+
558
+ </div>
559
+ </div>
560
+ <div class="tags">
561
+
562
+ </div><table class="source_code">
563
+ <tr>
564
+ <td>
565
+ <pre class="lines">
566
+
567
+
568
+ 62
569
+ 63
570
+ 64
571
+ 65
572
+ 66</pre>
573
+ </td>
574
+ <td>
575
+ <pre class="code"><span class="info file"># File 'lib/marilyn-rpc/service.rb', line 62</span>
576
+
577
+ <span class='def def kw'>def</span> <span class='execute_after_disconnect_callback! fid id'>execute_after_disconnect_callback!</span>
578
+ <span class='lparen token'>(</span><span class='@@_after_disconnect_callbacks ivar id'>@@_after_disconnect_callbacks</span> <span class='orop op'>||</span> <span class='lbrack token'>[</span><span class='rbrack token'>]</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='each identifier id'>each</span> <span class='do do kw'>do</span> <span class='bitor op'>|</span><span class='callback identifier id'>callback</span><span class='bitor op'>|</span>
579
+ <span class='self self kw'>self</span><span class='dot token'>.</span><span class='send identifier id'>send</span><span class='lparen token'>(</span><span class='callback identifier id'>callback</span><span class='rparen token'>)</span>
580
+ <span class='end end kw'>end</span>
581
+ <span class='end end kw'>end</span>
582
+ </pre>
583
+ </td>
584
+ </tr>
585
+ </table>
586
+ </div>
587
+
588
+ </div>
589
+
590
+ </div>
591
+
592
+ <div id="footer">
593
+ Generated on Wed Jun 8 18:26:44 2011 by
594
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
595
+ 0.6.8 (ruby-1.8.7).
596
+ </div>
597
+
598
+ </body>
599
+ </html>