ezmq 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +1 -0
- data/Gemfile +3 -0
- data/LICENSE +21 -0
- data/README.md +25 -0
- data/Rakefile +34 -0
- data/doc/EZMQ.html +126 -0
- data/doc/EZMQ/Client.html +385 -0
- data/doc/EZMQ/Publisher.html +401 -0
- data/doc/EZMQ/Server.html +449 -0
- data/doc/EZMQ/Socket.html +1084 -0
- data/doc/EZMQ/Subscriber.html +693 -0
- data/doc/_index.html +169 -0
- data/doc/class_list.html +58 -0
- data/doc/css/common.css +1 -0
- data/doc/css/full_list.css +57 -0
- data/doc/css/style.css +339 -0
- data/doc/file.README.html +95 -0
- data/doc/file_list.html +60 -0
- data/doc/frames.html +26 -0
- data/doc/index.html +95 -0
- data/doc/js/app.js +219 -0
- data/doc/js/full_list.js +181 -0
- data/doc/js/jquery.js +4 -0
- data/doc/method_list.html +183 -0
- data/doc/top-level-namespace.html +112 -0
- data/ezmq.gemspec +27 -0
- data/lib/ezmq.rb +227 -0
- metadata +212 -0
@@ -0,0 +1,401 @@
|
|
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>
|
7
|
+
Class: EZMQ::Publisher
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.6
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../';
|
20
|
+
framesUrl = "../frames.html#!EZMQ/Publisher.html";
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../_index.html">Index (P)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../EZMQ.html" title="EZMQ (module)">EZMQ</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">Publisher</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Class: EZMQ::Publisher
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
<dt class="r1">Inherits:</dt>
|
75
|
+
<dd class="r1">
|
76
|
+
<span class="inheritName"><span class='object_link'><a href="Socket.html" title="EZMQ::Socket (class)">Socket</a></span></span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next"><span class='object_link'><a href="Socket.html" title="EZMQ::Socket (class)">Socket</a></span></li>
|
82
|
+
|
83
|
+
<li class="next">EZMQ::Publisher</li>
|
84
|
+
|
85
|
+
</ul>
|
86
|
+
<a href="#" class="inheritanceTree">show all</a>
|
87
|
+
|
88
|
+
</dd>
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
<dt class="r2 last">Defined in:</dt>
|
99
|
+
<dd class="r2 last">lib/ezmq.rb</dd>
|
100
|
+
|
101
|
+
</dl>
|
102
|
+
<div class="clear"></div>
|
103
|
+
|
104
|
+
<h2>Overview</h2><div class="docstring">
|
105
|
+
<div class="discussion">
|
106
|
+
|
107
|
+
<p>Publish socket that broadcasts messages with an optional topic.</p>
|
108
|
+
|
109
|
+
|
110
|
+
</div>
|
111
|
+
</div>
|
112
|
+
<div class="tags">
|
113
|
+
|
114
|
+
|
115
|
+
</div>
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
<h2>Instance Attribute Summary</h2>
|
122
|
+
|
123
|
+
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Socket.html" title="EZMQ::Socket (class)">Socket</a></span></h3>
|
124
|
+
<p class="inherited"><span class='object_link'><a href="Socket.html#context-instance_method" title="EZMQ::Socket#context (method)">#context</a></span>, <span class='object_link'><a href="Socket.html#decode-instance_method" title="EZMQ::Socket#decode (method)">#decode</a></span>, <span class='object_link'><a href="Socket.html#encode-instance_method" title="EZMQ::Socket#encode (method)">#encode</a></span>, <span class='object_link'><a href="Socket.html#socket-instance_method" title="EZMQ::Socket#socket (method)">#socket</a></span></p>
|
125
|
+
|
126
|
+
|
127
|
+
|
128
|
+
<h2>
|
129
|
+
Instance Method Summary
|
130
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
131
|
+
</h2>
|
132
|
+
|
133
|
+
<ul class="summary">
|
134
|
+
|
135
|
+
<li class="public ">
|
136
|
+
<span class="summary_signature">
|
137
|
+
|
138
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Publisher) <strong>initialize</strong>(**options) </a>
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
</span>
|
143
|
+
|
144
|
+
|
145
|
+
<span class="note title constructor">constructor</span>
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
<span class="summary_desc"><div class='inline'>
|
155
|
+
<p>Creates a new Publisher socket.</p>
|
156
|
+
</div></span>
|
157
|
+
|
158
|
+
</li>
|
159
|
+
|
160
|
+
|
161
|
+
<li class="public ">
|
162
|
+
<span class="summary_signature">
|
163
|
+
|
164
|
+
<a href="#send-instance_method" title="#send (instance method)">- (Fixnum) <strong>send</strong>(message = '', topic: '', encode: @encode) </a>
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
</span>
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
<span class="summary_desc"><div class='inline'>
|
179
|
+
<p>Sends a message on the socket, with an optional topic.</p>
|
180
|
+
</div></span>
|
181
|
+
|
182
|
+
</li>
|
183
|
+
|
184
|
+
|
185
|
+
</ul>
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Socket.html" title="EZMQ::Socket (class)">Socket</a></span></h3>
|
198
|
+
<p class="inherited"><span class='object_link'><a href="Socket.html#bind-instance_method" title="EZMQ::Socket#bind (method)">#bind</a></span>, <span class='object_link'><a href="Socket.html#connect-instance_method" title="EZMQ::Socket#connect (method)">#connect</a></span>, <span class='object_link'><a href="Socket.html#receive-instance_method" title="EZMQ::Socket#receive (method)">#receive</a></span></p>
|
199
|
+
<div id="constructor_details" class="method_details_list">
|
200
|
+
<h2>Constructor Details</h2>
|
201
|
+
|
202
|
+
<div class="method_details first">
|
203
|
+
<h3 class="signature first" id="initialize-instance_method">
|
204
|
+
|
205
|
+
- (<tt><span class='object_link'><a href="" title="EZMQ::Publisher (class)">Publisher</a></span></tt>) <strong>initialize</strong>(**options)
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
</h3><div class="docstring">
|
212
|
+
<div class="discussion">
|
213
|
+
|
214
|
+
<p>Creates a new Publisher socket.</p>
|
215
|
+
|
216
|
+
|
217
|
+
</div>
|
218
|
+
</div>
|
219
|
+
<div class="tags">
|
220
|
+
<p class="tag_title">Parameters:</p>
|
221
|
+
<ul class="param">
|
222
|
+
|
223
|
+
<li>
|
224
|
+
|
225
|
+
<span class='name'>options</span>
|
226
|
+
|
227
|
+
|
228
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
—
|
233
|
+
<div class='inline'>
|
234
|
+
<p>optional parameters</p>
|
235
|
+
</div>
|
236
|
+
|
237
|
+
</li>
|
238
|
+
|
239
|
+
</ul>
|
240
|
+
|
241
|
+
|
242
|
+
<p class="tag_title">See Also:</p>
|
243
|
+
<ul class="see">
|
244
|
+
|
245
|
+
<li><span class='object_link'><a href="Socket.html" title="EZMQ::Socket (class)">EZMQ::Socket for a list of optional parameters.</a></span></li>
|
246
|
+
|
247
|
+
</ul>
|
248
|
+
|
249
|
+
</div><table class="source_code">
|
250
|
+
<tr>
|
251
|
+
<td>
|
252
|
+
<pre class="lines">
|
253
|
+
|
254
|
+
|
255
|
+
153
|
256
|
+
154
|
257
|
+
155</pre>
|
258
|
+
</td>
|
259
|
+
<td>
|
260
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line 153</span>
|
261
|
+
|
262
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='op'>**</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
263
|
+
<span class='kw'>super</span> <span class='symbol'>:bind</span><span class='comma'>,</span> <span class='const'>ZMQ</span><span class='op'>::</span><span class='const'>PUB</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span>
|
264
|
+
<span class='kw'>end</span></pre>
|
265
|
+
</td>
|
266
|
+
</tr>
|
267
|
+
</table>
|
268
|
+
</div>
|
269
|
+
|
270
|
+
</div>
|
271
|
+
|
272
|
+
|
273
|
+
<div id="instance_method_details" class="method_details_list">
|
274
|
+
<h2>Instance Method Details</h2>
|
275
|
+
|
276
|
+
|
277
|
+
<div class="method_details first">
|
278
|
+
<h3 class="signature first" id="send-instance_method">
|
279
|
+
|
280
|
+
- (<tt>Fixnum</tt>) <strong>send</strong>(message = '', topic: '', encode: @encode)
|
281
|
+
|
282
|
+
|
283
|
+
|
284
|
+
|
285
|
+
|
286
|
+
</h3><div class="docstring">
|
287
|
+
<div class="discussion">
|
288
|
+
|
289
|
+
<p>Sends a message on the socket, with an optional topic.</p>
|
290
|
+
|
291
|
+
|
292
|
+
</div>
|
293
|
+
</div>
|
294
|
+
<div class="tags">
|
295
|
+
<p class="tag_title">Parameters:</p>
|
296
|
+
<ul class="param">
|
297
|
+
|
298
|
+
<li>
|
299
|
+
|
300
|
+
<span class='name'>message</span>
|
301
|
+
|
302
|
+
|
303
|
+
<span class='type'>(<tt>String</tt>)</span>
|
304
|
+
|
305
|
+
|
306
|
+
<em class="default">(defaults to: <tt>''</tt>)</em>
|
307
|
+
|
308
|
+
|
309
|
+
—
|
310
|
+
<div class='inline'>
|
311
|
+
<p>the message to send.</p>
|
312
|
+
</div>
|
313
|
+
|
314
|
+
</li>
|
315
|
+
|
316
|
+
<li>
|
317
|
+
|
318
|
+
<span class='name'>topic</span>
|
319
|
+
|
320
|
+
|
321
|
+
<span class='type'>(<tt>String</tt>)</span>
|
322
|
+
|
323
|
+
|
324
|
+
|
325
|
+
—
|
326
|
+
<div class='inline'>
|
327
|
+
<p>an optional topic for the message.</p>
|
328
|
+
</div>
|
329
|
+
|
330
|
+
</li>
|
331
|
+
|
332
|
+
<li>
|
333
|
+
|
334
|
+
<span class='name'>encode</span>
|
335
|
+
|
336
|
+
|
337
|
+
<span class='type'>(<tt>lambda</tt>)</span>
|
338
|
+
|
339
|
+
|
340
|
+
|
341
|
+
—
|
342
|
+
<div class='inline'>
|
343
|
+
<p>how to encode the message.</p>
|
344
|
+
</div>
|
345
|
+
|
346
|
+
</li>
|
347
|
+
|
348
|
+
</ul>
|
349
|
+
|
350
|
+
<p class="tag_title">Returns:</p>
|
351
|
+
<ul class="return">
|
352
|
+
|
353
|
+
<li>
|
354
|
+
|
355
|
+
|
356
|
+
<span class='type'>(<tt>Fixnum</tt>)</span>
|
357
|
+
|
358
|
+
|
359
|
+
|
360
|
+
—
|
361
|
+
<div class='inline'>
|
362
|
+
<p>the size of the message.</p>
|
363
|
+
</div>
|
364
|
+
|
365
|
+
</li>
|
366
|
+
|
367
|
+
</ul>
|
368
|
+
|
369
|
+
</div><table class="source_code">
|
370
|
+
<tr>
|
371
|
+
<td>
|
372
|
+
<pre class="lines">
|
373
|
+
|
374
|
+
|
375
|
+
165
|
376
|
+
166
|
377
|
+
167</pre>
|
378
|
+
</td>
|
379
|
+
<td>
|
380
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line 165</span>
|
381
|
+
|
382
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_send'>send</span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>topic:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>encode:</span> <span class='ivar'>@encode</span><span class='rparen'>)</span>
|
383
|
+
<span class='ivar'>@socket</span><span class='period'>.</span><span class='id identifier rubyid_send_string'>send_string</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span> <span class='id identifier rubyid_topic'>topic</span> <span class='embexpr_end'>}</span><span class='tstring_content'> </span><span class='embexpr_beg'>#{</span> <span class='id identifier rubyid_encode'>encode</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span> <span class='id identifier rubyid_message'>message</span> <span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
384
|
+
<span class='kw'>end</span></pre>
|
385
|
+
</td>
|
386
|
+
</tr>
|
387
|
+
</table>
|
388
|
+
</div>
|
389
|
+
|
390
|
+
</div>
|
391
|
+
|
392
|
+
</div>
|
393
|
+
|
394
|
+
<div id="footer">
|
395
|
+
Generated on Tue Jan 6 11:26:34 2015 by
|
396
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
397
|
+
0.8.7.6 (ruby-2.0.0).
|
398
|
+
</div>
|
399
|
+
|
400
|
+
</body>
|
401
|
+
</html>
|
@@ -0,0 +1,449 @@
|
|
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>
|
7
|
+
Class: EZMQ::Server
|
8
|
+
|
9
|
+
— Documentation by YARD 0.8.7.6
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
hasFrames = window.top.frames.main ? true : false;
|
19
|
+
relpath = '../';
|
20
|
+
framesUrl = "../frames.html#!EZMQ/Server.html";
|
21
|
+
</script>
|
22
|
+
|
23
|
+
|
24
|
+
<script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
|
25
|
+
|
26
|
+
<script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
|
27
|
+
|
28
|
+
|
29
|
+
</head>
|
30
|
+
<body>
|
31
|
+
<div id="header">
|
32
|
+
<div id="menu">
|
33
|
+
|
34
|
+
<a href="../_index.html">Index (S)</a> »
|
35
|
+
<span class='title'><span class='object_link'><a href="../EZMQ.html" title="EZMQ (module)">EZMQ</a></span></span>
|
36
|
+
»
|
37
|
+
<span class="title">Server</span>
|
38
|
+
|
39
|
+
|
40
|
+
<div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
|
41
|
+
</div>
|
42
|
+
|
43
|
+
<div id="search">
|
44
|
+
|
45
|
+
<a class="full_list_link" id="class_list_link"
|
46
|
+
href="../class_list.html">
|
47
|
+
Class List
|
48
|
+
</a>
|
49
|
+
|
50
|
+
<a class="full_list_link" id="method_list_link"
|
51
|
+
href="../method_list.html">
|
52
|
+
Method List
|
53
|
+
</a>
|
54
|
+
|
55
|
+
<a class="full_list_link" id="file_list_link"
|
56
|
+
href="../file_list.html">
|
57
|
+
File List
|
58
|
+
</a>
|
59
|
+
|
60
|
+
</div>
|
61
|
+
<div class="clear"></div>
|
62
|
+
</div>
|
63
|
+
|
64
|
+
<iframe id="search_frame"></iframe>
|
65
|
+
|
66
|
+
<div id="content"><h1>Class: EZMQ::Server
|
67
|
+
|
68
|
+
|
69
|
+
|
70
|
+
</h1>
|
71
|
+
|
72
|
+
<dl class="box">
|
73
|
+
|
74
|
+
<dt class="r1">Inherits:</dt>
|
75
|
+
<dd class="r1">
|
76
|
+
<span class="inheritName"><span class='object_link'><a href="Socket.html" title="EZMQ::Socket (class)">Socket</a></span></span>
|
77
|
+
|
78
|
+
<ul class="fullTree">
|
79
|
+
<li>Object</li>
|
80
|
+
|
81
|
+
<li class="next"><span class='object_link'><a href="Socket.html" title="EZMQ::Socket (class)">Socket</a></span></li>
|
82
|
+
|
83
|
+
<li class="next">EZMQ::Server</li>
|
84
|
+
|
85
|
+
</ul>
|
86
|
+
<a href="#" class="inheritanceTree">show all</a>
|
87
|
+
|
88
|
+
</dd>
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
|
96
|
+
|
97
|
+
|
98
|
+
<dt class="r2 last">Defined in:</dt>
|
99
|
+
<dd class="r2 last">lib/ezmq.rb</dd>
|
100
|
+
|
101
|
+
</dl>
|
102
|
+
<div class="clear"></div>
|
103
|
+
|
104
|
+
<h2>Overview</h2><div class="docstring">
|
105
|
+
<div class="discussion">
|
106
|
+
|
107
|
+
<p>Reply socket that listens for and replies to requests.</p>
|
108
|
+
|
109
|
+
|
110
|
+
</div>
|
111
|
+
</div>
|
112
|
+
<div class="tags">
|
113
|
+
|
114
|
+
|
115
|
+
</div>
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
<h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
|
120
|
+
<ul class="summary">
|
121
|
+
|
122
|
+
<li class="public ">
|
123
|
+
<span class="summary_signature">
|
124
|
+
|
125
|
+
<a href="#provides-instance_method" title="#provides (instance method)">- (Object) <strong>provides</strong> </a>
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
</span>
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
|
141
|
+
|
142
|
+
<span class="summary_desc"><div class='inline'>
|
143
|
+
<p>Returns the value of attribute provides.</p>
|
144
|
+
</div></span>
|
145
|
+
|
146
|
+
</li>
|
147
|
+
|
148
|
+
|
149
|
+
</ul>
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
<h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Socket.html" title="EZMQ::Socket (class)">Socket</a></span></h3>
|
156
|
+
<p class="inherited"><span class='object_link'><a href="Socket.html#context-instance_method" title="EZMQ::Socket#context (method)">#context</a></span>, <span class='object_link'><a href="Socket.html#decode-instance_method" title="EZMQ::Socket#decode (method)">#decode</a></span>, <span class='object_link'><a href="Socket.html#encode-instance_method" title="EZMQ::Socket#encode (method)">#encode</a></span>, <span class='object_link'><a href="Socket.html#socket-instance_method" title="EZMQ::Socket#socket (method)">#socket</a></span></p>
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
<h2>
|
161
|
+
Instance Method Summary
|
162
|
+
<small>(<a href="#" class="summary_toggle">collapse</a>)</small>
|
163
|
+
</h2>
|
164
|
+
|
165
|
+
<ul class="summary">
|
166
|
+
|
167
|
+
<li class="public ">
|
168
|
+
<span class="summary_signature">
|
169
|
+
|
170
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Server) <strong>initialize</strong>(provides: -> m { m }, **options) </a>
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
</span>
|
175
|
+
|
176
|
+
|
177
|
+
<span class="note title constructor">constructor</span>
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
<span class="summary_desc"><div class='inline'>
|
187
|
+
<p>Creates a new Server socket.</p>
|
188
|
+
</div></span>
|
189
|
+
|
190
|
+
</li>
|
191
|
+
|
192
|
+
|
193
|
+
<li class="public ">
|
194
|
+
<span class="summary_signature">
|
195
|
+
|
196
|
+
<a href="#listen-instance_method" title="#listen (instance method)">- (void) <strong>listen</strong>(handler: -> { send @provides.call(receive) }) </a>
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
</span>
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
<span class="summary_desc"><div class='inline'>
|
211
|
+
<p>By default, waits to receive a message, calls @action with it, replies with
|
212
|
+
the result, then loops.</p>
|
213
|
+
</div></span>
|
214
|
+
|
215
|
+
</li>
|
216
|
+
|
217
|
+
|
218
|
+
</ul>
|
219
|
+
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Socket.html" title="EZMQ::Socket (class)">Socket</a></span></h3>
|
231
|
+
<p class="inherited"><span class='object_link'><a href="Socket.html#bind-instance_method" title="EZMQ::Socket#bind (method)">#bind</a></span>, <span class='object_link'><a href="Socket.html#connect-instance_method" title="EZMQ::Socket#connect (method)">#connect</a></span>, <span class='object_link'><a href="Socket.html#receive-instance_method" title="EZMQ::Socket#receive (method)">#receive</a></span>, <span class='object_link'><a href="Socket.html#send-instance_method" title="EZMQ::Socket#send (method)">#send</a></span></p>
|
232
|
+
<div id="constructor_details" class="method_details_list">
|
233
|
+
<h2>Constructor Details</h2>
|
234
|
+
|
235
|
+
<div class="method_details first">
|
236
|
+
<h3 class="signature first" id="initialize-instance_method">
|
237
|
+
|
238
|
+
- (<tt><span class='object_link'><a href="" title="EZMQ::Server (class)">Server</a></span></tt>) <strong>initialize</strong>(provides: -> m { m }, **options)
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
|
244
|
+
</h3><div class="docstring">
|
245
|
+
<div class="discussion">
|
246
|
+
|
247
|
+
<p>Creates a new Server socket.</p>
|
248
|
+
|
249
|
+
|
250
|
+
</div>
|
251
|
+
</div>
|
252
|
+
<div class="tags">
|
253
|
+
<p class="tag_title">Parameters:</p>
|
254
|
+
<ul class="param">
|
255
|
+
|
256
|
+
<li>
|
257
|
+
|
258
|
+
<span class='name'>provides</span>
|
259
|
+
|
260
|
+
|
261
|
+
<span class='type'>(<tt>lambda</tt>)</span>
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
—
|
266
|
+
<div class='inline'>
|
267
|
+
<p>the service provided by this server.</p>
|
268
|
+
</div>
|
269
|
+
|
270
|
+
</li>
|
271
|
+
|
272
|
+
<li>
|
273
|
+
|
274
|
+
<span class='name'>options</span>
|
275
|
+
|
276
|
+
|
277
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
—
|
282
|
+
<div class='inline'>
|
283
|
+
<p>optional parameters</p>
|
284
|
+
</div>
|
285
|
+
|
286
|
+
</li>
|
287
|
+
|
288
|
+
</ul>
|
289
|
+
|
290
|
+
|
291
|
+
<p class="tag_title">See Also:</p>
|
292
|
+
<ul class="see">
|
293
|
+
|
294
|
+
<li><span class='object_link'><a href="Socket.html" title="EZMQ::Socket (class)">EZMQ::Socket for a list of optional parameters.</a></span></li>
|
295
|
+
|
296
|
+
</ul>
|
297
|
+
|
298
|
+
</div><table class="source_code">
|
299
|
+
<tr>
|
300
|
+
<td>
|
301
|
+
<pre class="lines">
|
302
|
+
|
303
|
+
|
304
|
+
98
|
305
|
+
99
|
306
|
+
100
|
307
|
+
101</pre>
|
308
|
+
</td>
|
309
|
+
<td>
|
310
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line 98</span>
|
311
|
+
|
312
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>provides:</span> <span class='tlambda'>-></span> <span class='id identifier rubyid_m'>m</span> <span class='tlambeg'>{</span> <span class='id identifier rubyid_m'>m</span> <span class='rbrace'>}</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
313
|
+
<span class='ivar'>@provides</span> <span class='op'>=</span> <span class='id identifier rubyid_provides'>provides</span>
|
314
|
+
<span class='kw'>super</span> <span class='symbol'>:bind</span><span class='comma'>,</span> <span class='const'>ZMQ</span><span class='op'>::</span><span class='const'>REP</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span>
|
315
|
+
<span class='kw'>end</span></pre>
|
316
|
+
</td>
|
317
|
+
</tr>
|
318
|
+
</table>
|
319
|
+
</div>
|
320
|
+
|
321
|
+
</div>
|
322
|
+
|
323
|
+
<div id="instance_attr_details" class="attr_details">
|
324
|
+
<h2>Instance Attribute Details</h2>
|
325
|
+
|
326
|
+
|
327
|
+
<span id="provides=-instance_method"></span>
|
328
|
+
<div class="method_details first">
|
329
|
+
<h3 class="signature first" id="provides-instance_method">
|
330
|
+
|
331
|
+
- (<tt>Object</tt>) <strong>provides</strong>
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
|
337
|
+
</h3><div class="docstring">
|
338
|
+
<div class="discussion">
|
339
|
+
|
340
|
+
<p>Returns the value of attribute provides</p>
|
341
|
+
|
342
|
+
|
343
|
+
</div>
|
344
|
+
</div>
|
345
|
+
<div class="tags">
|
346
|
+
|
347
|
+
|
348
|
+
</div><table class="source_code">
|
349
|
+
<tr>
|
350
|
+
<td>
|
351
|
+
<pre class="lines">
|
352
|
+
|
353
|
+
|
354
|
+
87
|
355
|
+
88
|
356
|
+
89</pre>
|
357
|
+
</td>
|
358
|
+
<td>
|
359
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line 87</span>
|
360
|
+
|
361
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_provides'>provides</span>
|
362
|
+
<span class='ivar'>@provides</span>
|
363
|
+
<span class='kw'>end</span></pre>
|
364
|
+
</td>
|
365
|
+
</tr>
|
366
|
+
</table>
|
367
|
+
</div>
|
368
|
+
|
369
|
+
</div>
|
370
|
+
|
371
|
+
|
372
|
+
<div id="instance_method_details" class="method_details_list">
|
373
|
+
<h2>Instance Method Details</h2>
|
374
|
+
|
375
|
+
|
376
|
+
<div class="method_details first">
|
377
|
+
<h3 class="signature first" id="listen-instance_method">
|
378
|
+
|
379
|
+
- (<tt>void</tt>) <strong>listen</strong>(handler: -> { send @provides.call(receive) })
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
|
384
|
+
|
385
|
+
</h3><div class="docstring">
|
386
|
+
<div class="discussion">
|
387
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
388
|
+
<p>By default, waits to receive a message, calls @action with it, replies with
|
389
|
+
the result, then loops.</p>
|
390
|
+
|
391
|
+
|
392
|
+
</div>
|
393
|
+
</div>
|
394
|
+
<div class="tags">
|
395
|
+
<p class="tag_title">Parameters:</p>
|
396
|
+
<ul class="param">
|
397
|
+
|
398
|
+
<li>
|
399
|
+
|
400
|
+
<span class='name'>handler</span>
|
401
|
+
|
402
|
+
|
403
|
+
<span class='type'>(<tt>lambda</tt>)</span>
|
404
|
+
|
405
|
+
|
406
|
+
|
407
|
+
—
|
408
|
+
<div class='inline'>
|
409
|
+
<p>how requests are handled.</p>
|
410
|
+
</div>
|
411
|
+
|
412
|
+
</li>
|
413
|
+
|
414
|
+
</ul>
|
415
|
+
|
416
|
+
|
417
|
+
</div><table class="source_code">
|
418
|
+
<tr>
|
419
|
+
<td>
|
420
|
+
<pre class="lines">
|
421
|
+
|
422
|
+
|
423
|
+
110
|
424
|
+
111
|
425
|
+
112</pre>
|
426
|
+
</td>
|
427
|
+
<td>
|
428
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line 110</span>
|
429
|
+
|
430
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_listen'>listen</span><span class='lparen'>(</span><span class='label'>handler:</span> <span class='tlambda'>-></span> <span class='tlambeg'>{</span> <span class='id identifier rubyid_send'>send</span> <span class='ivar'>@provides</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span><span class='lparen'>(</span><span class='id identifier rubyid_receive'>receive</span><span class='rparen'>)</span> <span class='rbrace'>}</span><span class='rparen'>)</span>
|
431
|
+
<span class='id identifier rubyid_loop'>loop</span> <span class='lbrace'>{</span> <span class='id identifier rubyid_handler'>handler</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span> <span class='rbrace'>}</span>
|
432
|
+
<span class='kw'>end</span></pre>
|
433
|
+
</td>
|
434
|
+
</tr>
|
435
|
+
</table>
|
436
|
+
</div>
|
437
|
+
|
438
|
+
</div>
|
439
|
+
|
440
|
+
</div>
|
441
|
+
|
442
|
+
<div id="footer">
|
443
|
+
Generated on Tue Jan 6 11:26:34 2015 by
|
444
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
445
|
+
0.8.7.6 (ruby-2.0.0).
|
446
|
+
</div>
|
447
|
+
|
448
|
+
</body>
|
449
|
+
</html>
|