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.
- data/LICENCE +18 -0
- data/README.md +170 -0
- data/doc/MarilynRPC/CallRequestMail.html +578 -0
- data/doc/MarilynRPC/CallResponseMail.html +418 -0
- data/doc/MarilynRPC/Envelope.html +705 -0
- data/doc/MarilynRPC/ExceptionMail.html +338 -0
- data/doc/MarilynRPC/Gentleman.html +658 -0
- data/doc/MarilynRPC/MailFactory.html +284 -0
- data/doc/MarilynRPC/MailHelper.html +489 -0
- data/doc/MarilynRPC/NativeClient.html +579 -0
- data/doc/MarilynRPC/NativeClientProxy.html +303 -0
- data/doc/MarilynRPC/Server.html +406 -0
- data/doc/MarilynRPC/Service.html +599 -0
- data/doc/MarilynRPC/ServiceCache.html +481 -0
- data/doc/MarilynRPC.html +108 -0
- data/doc/_index.html +219 -0
- data/doc/class_list.html +36 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +53 -0
- data/doc/css/style.css +318 -0
- data/doc/file.README.html +154 -0
- data/doc/file_list.html +38 -0
- data/doc/frames.html +13 -0
- data/doc/index.html +154 -0
- data/doc/js/app.js +203 -0
- data/doc/js/full_list.js +149 -0
- data/doc/js/jquery.js +16 -0
- data/doc/method_list.html +467 -0
- data/doc/top-level-namespace.html +88 -0
- data/examples/async/client.rb +40 -0
- data/examples/async/server.rb +26 -0
- data/examples/callbacks/client.rb +8 -0
- data/examples/callbacks/server.rb +26 -0
- data/examples/secure/client.rb +9 -0
- data/examples/secure/server.rb +22 -0
- data/kiss.png +0 -0
- data/lib/marilyn-rpc/client.rb +91 -26
- data/lib/marilyn-rpc/gentleman.rb +4 -1
- data/lib/marilyn-rpc/mails.rb +1 -1
- data/lib/marilyn-rpc/server.rb +27 -3
- data/lib/marilyn-rpc/service.rb +64 -0
- data/lib/marilyn-rpc/service_cache.rb +13 -2
- data/lib/marilyn-rpc/version.rb +1 -1
- metadata +39 -3
@@ -0,0 +1,284 @@
|
|
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>Module: MarilynRPC::MailFactory</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 (M)</a> »
|
27
|
+
<span class='title'><span class='object_link'><a href="../MarilynRPC.html" title="MarilynRPC (module)">MarilynRPC</a></span></span>
|
28
|
+
»
|
29
|
+
<span class="title">MailFactory</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>Module: MarilynRPC::MailFactory
|
47
|
+
|
48
|
+
|
49
|
+
|
50
|
+
</h1>
|
51
|
+
|
52
|
+
<dl class="box">
|
53
|
+
|
54
|
+
|
55
|
+
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
|
60
|
+
|
61
|
+
<dt class="r1 last">Defined in:</dt>
|
62
|
+
<dd class="r1 last">lib/marilyn-rpc/mails.rb</dd>
|
63
|
+
|
64
|
+
</dl>
|
65
|
+
<div class="clear"></div>
|
66
|
+
|
67
|
+
<h2>Overview</h2><div class="docstring">
|
68
|
+
<div class="discussion">
|
69
|
+
<p>Helper to destiguish between the different mails</p>
|
70
|
+
|
71
|
+
</div>
|
72
|
+
</div>
|
73
|
+
<div class="tags">
|
74
|
+
|
75
|
+
</div>
|
76
|
+
|
77
|
+
|
78
|
+
|
79
|
+
<h2>
|
80
|
+
Class Method Summary
|
81
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
82
|
+
</h2>
|
83
|
+
|
84
|
+
<ul class="summary">
|
85
|
+
|
86
|
+
<li class="public ">
|
87
|
+
<span class="summary_signature">
|
88
|
+
|
89
|
+
<a href="#build_call-class_method" title="build_call (class method)">+ (Object) <strong>build_call</strong>(tag, path, method_name, args) </a>
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
</span>
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
<span class="summary_desc"><div class='inline'><p>builds the binary data for a method call.</p></div></span>
|
103
|
+
|
104
|
+
</li>
|
105
|
+
|
106
|
+
|
107
|
+
<li class="public ">
|
108
|
+
<span class="summary_signature">
|
109
|
+
|
110
|
+
<a href="#unpack-class_method" title="unpack (class method)">+ (MarilynRPC::CallRequestMail, ...) <strong>unpack</strong>(envelope) </a>
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
</span>
|
115
|
+
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
<span class="summary_desc"><div class='inline'><p>Parses the envelop and generate the correct mail.</p></div></span>
|
124
|
+
|
125
|
+
</li>
|
126
|
+
|
127
|
+
|
128
|
+
</ul>
|
129
|
+
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
<div id="class_method_details" class="method_details_list">
|
134
|
+
<h2>Class Method Details</h2>
|
135
|
+
|
136
|
+
|
137
|
+
<div class="method_details first">
|
138
|
+
<p class="signature first" id="build_call-class_method">
|
139
|
+
|
140
|
+
+ (<tt>Object</tt>) <strong>build_call</strong>(tag, path, method_name, args)
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
</p><div class="docstring">
|
145
|
+
<div class="discussion">
|
146
|
+
<p>builds the binary data for a method call</p>
|
147
|
+
|
148
|
+
</div>
|
149
|
+
</div>
|
150
|
+
<div class="tags">
|
151
|
+
|
152
|
+
</div><table class="source_code">
|
153
|
+
<tr>
|
154
|
+
<td>
|
155
|
+
<pre class="lines">
|
156
|
+
|
157
|
+
|
158
|
+
96
|
159
|
+
97
|
160
|
+
98
|
161
|
+
99</pre>
|
162
|
+
</td>
|
163
|
+
<td>
|
164
|
+
<pre class="code"><span class="info file"># File 'lib/marilyn-rpc/mails.rb', line 96</span>
|
165
|
+
|
166
|
+
<span class='def def kw'>def</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='build_call identifier id'>build_call</span><span class='lparen token'>(</span><span class='tag identifier id'>tag</span><span class='comma token'>,</span> <span class='path identifier id'>path</span><span class='comma token'>,</span> <span class='method_name identifier id'>method_name</span><span class='comma token'>,</span> <span class='args identifier id'>args</span><span class='rparen token'>)</span>
|
167
|
+
<span class='mail identifier id'>mail</span> <span class='assign token'>=</span> <span class='MarilynRPC constant id'>MarilynRPC</span><span class='colon2 op'>::</span><span class='CallRequestMail constant id'>CallRequestMail</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='tag identifier id'>tag</span><span class='comma token'>,</span> <span class='path identifier id'>path</span><span class='comma token'>,</span> <span class='method_name identifier id'>method_name</span><span class='comma token'>,</span> <span class='args identifier id'>args</span><span class='rparen token'>)</span>
|
168
|
+
<span class='MarilynRPC constant id'>MarilynRPC</span><span class='colon2 op'>::</span><span class='Envelope constant id'>Envelope</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='mail identifier id'>mail</span><span class='dot token'>.</span><span class='encode identifier id'>encode</span><span class='rparen token'>)</span><span class='dot token'>.</span><span class='encode identifier id'>encode</span>
|
169
|
+
<span class='end end kw'>end</span>
|
170
|
+
</pre>
|
171
|
+
</td>
|
172
|
+
</tr>
|
173
|
+
</table>
|
174
|
+
</div>
|
175
|
+
|
176
|
+
<div class="method_details ">
|
177
|
+
<p class="signature " id="unpack-class_method">
|
178
|
+
|
179
|
+
+ (<tt><span class='object_link'><a href="CallRequestMail.html" title="MarilynRPC::CallRequestMail (class)">MarilynRPC::CallRequestMail</a></span></tt>, ...) <strong>unpack</strong>(envelope)
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
</p><div class="docstring">
|
184
|
+
<div class="discussion">
|
185
|
+
<p>Parses the envelop and generate the correct mail.</p>
|
186
|
+
|
187
|
+
</div>
|
188
|
+
</div>
|
189
|
+
<div class="tags">
|
190
|
+
<h3>Parameters:</h3>
|
191
|
+
<ul class="param">
|
192
|
+
|
193
|
+
<li>
|
194
|
+
|
195
|
+
<span class='type'>(<tt><span class='object_link'><a href="Envelope.html" title="MarilynRPC::Envelope (class)">MarilynRPC::Envelope</a></span></tt>)</span>
|
196
|
+
|
197
|
+
|
198
|
+
<span class='name'>envelope</span>
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
—
|
203
|
+
<div class='inline'><p>the envelope which contains a mail</p></div>
|
204
|
+
|
205
|
+
</li>
|
206
|
+
|
207
|
+
</ul>
|
208
|
+
<h3>Returns:</h3>
|
209
|
+
<ul class="return">
|
210
|
+
|
211
|
+
<li>
|
212
|
+
|
213
|
+
<span class='type'>(<tt><span class='object_link'><a href="CallRequestMail.html" title="MarilynRPC::CallRequestMail (class)">MarilynRPC::CallRequestMail</a></span></tt>, <tt><span class='object_link'><a href="CallResponseMail.html" title="MarilynRPC::CallResponseMail (class)">MarilynRPC::CallResponseMail</a></span></tt>, <tt><span class='object_link'><a href="ExceptionMail.html" title="MarilynRPC::ExceptionMail (class)">MarilynRPC::ExceptionMail</a></span></tt>)</span>
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
|
218
|
+
—
|
219
|
+
<div class='inline'><p>the mail object that was extracted</p></div>
|
220
|
+
|
221
|
+
</li>
|
222
|
+
|
223
|
+
</ul>
|
224
|
+
|
225
|
+
</div><table class="source_code">
|
226
|
+
<tr>
|
227
|
+
<td>
|
228
|
+
<pre class="lines">
|
229
|
+
|
230
|
+
|
231
|
+
78
|
232
|
+
79
|
233
|
+
80
|
234
|
+
81
|
235
|
+
82
|
236
|
+
83
|
237
|
+
84
|
238
|
+
85
|
239
|
+
86
|
240
|
+
87
|
241
|
+
88
|
242
|
+
89
|
243
|
+
90
|
244
|
+
91
|
245
|
+
92
|
246
|
+
93</pre>
|
247
|
+
</td>
|
248
|
+
<td>
|
249
|
+
<pre class="code"><span class="info file"># File 'lib/marilyn-rpc/mails.rb', line 78</span>
|
250
|
+
|
251
|
+
<span class='def def kw'>def</span> <span class='self self kw'>self</span><span class='dot token'>.</span><span class='unpack identifier id'>unpack</span><span class='lparen token'>(</span><span class='envelope identifier id'>envelope</span><span class='rparen token'>)</span>
|
252
|
+
<span class='data identifier id'>data</span> <span class='assign token'>=</span> <span class='envelope identifier id'>envelope</span><span class='dot token'>.</span><span class='content identifier id'>content</span>
|
253
|
+
<span class='type identifier id'>type</span> <span class='assign token'>=</span> <span class='data identifier id'>data</span><span class='dot token'>.</span><span class='slice identifier id'>slice</span><span class='lparen token'>(</span><span class='integer val'>0</span><span class='comma token'>,</span> <span class='integer val'>1</span><span class='rparen token'>)</span>
|
254
|
+
<span class='case case kw'>case</span> <span class='type identifier id'>type</span>
|
255
|
+
<span class='when when kw'>when</span> <span class='MarilynRPC constant id'>MarilynRPC</span><span class='colon2 op'>::</span><span class='CallRequestMail constant id'>CallRequestMail</span><span class='colon2 op'>::</span><span class='TYPE constant id'>TYPE</span>
|
256
|
+
<span class='mail identifier id'>mail</span> <span class='assign token'>=</span> <span class='MarilynRPC constant id'>MarilynRPC</span><span class='colon2 op'>::</span><span class='CallRequestMail constant id'>CallRequestMail</span><span class='dot token'>.</span><span class='new identifier id'>new</span>
|
257
|
+
<span class='when when kw'>when</span> <span class='MarilynRPC constant id'>MarilynRPC</span><span class='colon2 op'>::</span><span class='CallResponseMail constant id'>CallResponseMail</span><span class='colon2 op'>::</span><span class='TYPE constant id'>TYPE</span>
|
258
|
+
<span class='mail identifier id'>mail</span> <span class='assign token'>=</span> <span class='MarilynRPC constant id'>MarilynRPC</span><span class='colon2 op'>::</span><span class='CallResponseMail constant id'>CallResponseMail</span><span class='dot token'>.</span><span class='new identifier id'>new</span>
|
259
|
+
<span class='when when kw'>when</span> <span class='MarilynRPC constant id'>MarilynRPC</span><span class='colon2 op'>::</span><span class='ExceptionMail constant id'>ExceptionMail</span><span class='colon2 op'>::</span><span class='TYPE constant id'>TYPE</span>
|
260
|
+
<span class='mail identifier id'>mail</span> <span class='assign token'>=</span> <span class='MarilynRPC constant id'>MarilynRPC</span><span class='colon2 op'>::</span><span class='ExceptionMail constant id'>ExceptionMail</span><span class='dot token'>.</span><span class='new identifier id'>new</span>
|
261
|
+
<span class='else else kw'>else</span>
|
262
|
+
<span class='raise identifier id'>raise</span> <span class='ArgumentError constant id'>ArgumentError</span><span class='dot token'>.</span><span class='new identifier id'>new</span><span class='lparen token'>(</span><span class='dstring node'>"The passed type #{type.inspect} is unknown!"</span><span class='rparen token'>)</span>
|
263
|
+
<span class='end end kw'>end</span>
|
264
|
+
<span class='mail identifier id'>mail</span><span class='dot token'>.</span><span class='decode identifier id'>decode</span><span class='lparen token'>(</span><span class='data identifier id'>data</span><span class='rparen token'>)</span>
|
265
|
+
<span class='mail identifier id'>mail</span>
|
266
|
+
<span class='end end kw'>end</span>
|
267
|
+
</pre>
|
268
|
+
</td>
|
269
|
+
</tr>
|
270
|
+
</table>
|
271
|
+
</div>
|
272
|
+
|
273
|
+
</div>
|
274
|
+
|
275
|
+
</div>
|
276
|
+
|
277
|
+
<div id="footer">
|
278
|
+
Generated on Wed Jun 8 18:26:47 2011 by
|
279
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
280
|
+
0.6.8 (ruby-1.8.7).
|
281
|
+
</div>
|
282
|
+
|
283
|
+
</body>
|
284
|
+
</html>
|