ezmq 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +59 -0
- data/doc/EZMQ.html +2 -2
- data/doc/EZMQ/Client.html +15 -15
- data/doc/EZMQ/Publisher.html +10 -10
- data/doc/EZMQ/Puller.html +276 -0
- data/doc/EZMQ/Pusher.html +276 -0
- data/doc/EZMQ/Server.html +15 -15
- data/doc/EZMQ/Socket.html +172 -56
- data/doc/EZMQ/Subscriber.html +20 -135
- data/doc/_index.html +15 -1
- data/doc/class_list.html +1 -1
- data/doc/file.README.html +70 -16
- data/doc/index.html +70 -16
- data/doc/method_list.html +24 -12
- data/doc/top-level-namespace.html +1 -1
- data/ezmq.gemspec +1 -1
- data/lib/ezmq.rb +59 -32
- metadata +4 -2
@@ -0,0 +1,276 @@
|
|
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::Pusher
|
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/Pusher.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">Pusher</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::Pusher
|
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::Pusher</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>Push socket that sends messages but does not receive them.</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)">- (Pusher) <strong>initialize</strong>(mode = :connect, **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 Pusher socket.</p>
|
156
|
+
</div></span>
|
157
|
+
|
158
|
+
</li>
|
159
|
+
|
160
|
+
|
161
|
+
</ul>
|
162
|
+
|
163
|
+
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Socket.html" title="EZMQ::Socket (class)">Socket</a></span></h3>
|
174
|
+
<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#listen-instance_method" title="EZMQ::Socket#listen (method)">#listen</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>
|
175
|
+
<div id="constructor_details" class="method_details_list">
|
176
|
+
<h2>Constructor Details</h2>
|
177
|
+
|
178
|
+
<div class="method_details first">
|
179
|
+
<h3 class="signature first" id="initialize-instance_method">
|
180
|
+
|
181
|
+
- (<tt><span class='object_link'><a href="" title="EZMQ::Pusher (class)">Pusher</a></span></tt>) <strong>initialize</strong>(mode = :connect, **options)
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
|
187
|
+
</h3><div class="docstring">
|
188
|
+
<div class="discussion">
|
189
|
+
|
190
|
+
<p>Creates a new Pusher socket.</p>
|
191
|
+
|
192
|
+
|
193
|
+
</div>
|
194
|
+
</div>
|
195
|
+
<div class="tags">
|
196
|
+
<p class="tag_title">Parameters:</p>
|
197
|
+
<ul class="param">
|
198
|
+
|
199
|
+
<li>
|
200
|
+
|
201
|
+
<span class='name'>mode</span>
|
202
|
+
|
203
|
+
|
204
|
+
<span class='type'>(<tt>:bind</tt>, <tt>:connect</tt>)</span>
|
205
|
+
|
206
|
+
|
207
|
+
<em class="default">(defaults to: <tt>:connect</tt>)</em>
|
208
|
+
|
209
|
+
|
210
|
+
—
|
211
|
+
<div class='inline'>
|
212
|
+
<p>a mode for the socket.</p>
|
213
|
+
</div>
|
214
|
+
|
215
|
+
</li>
|
216
|
+
|
217
|
+
<li>
|
218
|
+
|
219
|
+
<span class='name'>options</span>
|
220
|
+
|
221
|
+
|
222
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
—
|
227
|
+
<div class='inline'>
|
228
|
+
<p>optional parameters.</p>
|
229
|
+
</div>
|
230
|
+
|
231
|
+
</li>
|
232
|
+
|
233
|
+
</ul>
|
234
|
+
|
235
|
+
|
236
|
+
<p class="tag_title">See Also:</p>
|
237
|
+
<ul class="see">
|
238
|
+
|
239
|
+
<li><span class='object_link'><a href="Socket.html" title="EZMQ::Socket (class)">EZMQ::Socket for optional parameters.</a></span></li>
|
240
|
+
|
241
|
+
</ul>
|
242
|
+
|
243
|
+
</div><table class="source_code">
|
244
|
+
<tr>
|
245
|
+
<td>
|
246
|
+
<pre class="lines">
|
247
|
+
|
248
|
+
|
249
|
+
274
|
250
|
+
275
|
251
|
+
276</pre>
|
252
|
+
</td>
|
253
|
+
<td>
|
254
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line 274</span>
|
255
|
+
|
256
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_mode'>mode</span> <span class='op'>=</span> <span class='symbol'>:connect</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
257
|
+
<span class='kw'>super</span> <span class='id identifier rubyid_mode'>mode</span><span class='comma'>,</span> <span class='const'>ZMQ</span><span class='op'>::</span><span class='const'>PUSH</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span>
|
258
|
+
<span class='kw'>end</span></pre>
|
259
|
+
</td>
|
260
|
+
</tr>
|
261
|
+
</table>
|
262
|
+
</div>
|
263
|
+
|
264
|
+
</div>
|
265
|
+
|
266
|
+
|
267
|
+
</div>
|
268
|
+
|
269
|
+
<div id="footer">
|
270
|
+
Generated on Sun Jan 11 14:20:10 2015 by
|
271
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
272
|
+
0.8.7.6 (ruby-2.0.0).
|
273
|
+
</div>
|
274
|
+
|
275
|
+
</body>
|
276
|
+
</html>
|
data/doc/EZMQ/Server.html
CHANGED
@@ -252,12 +252,12 @@
|
|
252
252
|
<pre class="lines">
|
253
253
|
|
254
254
|
|
255
|
-
|
256
|
-
|
257
|
-
|
255
|
+
166
|
256
|
+
167
|
257
|
+
168</pre>
|
258
258
|
</td>
|
259
259
|
<td>
|
260
|
-
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line
|
260
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line 166</span>
|
261
261
|
|
262
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
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'>REP</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span>
|
@@ -358,18 +358,18 @@
|
|
358
358
|
<pre class="lines">
|
359
359
|
|
360
360
|
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
361
|
+
180
|
362
|
+
181
|
363
|
+
182
|
364
|
+
183
|
365
|
+
184
|
366
|
+
185
|
367
|
+
186
|
368
|
+
187
|
369
|
+
188</pre>
|
370
370
|
</td>
|
371
371
|
<td>
|
372
|
-
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line
|
372
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line 180</span>
|
373
373
|
|
374
374
|
<span class='kw'>def</span> <span class='id identifier rubyid_listen'>listen</span>
|
375
375
|
<span class='id identifier rubyid_loop'>loop</span> <span class='kw'>do</span>
|
@@ -390,7 +390,7 @@
|
|
390
390
|
</div>
|
391
391
|
|
392
392
|
<div id="footer">
|
393
|
-
Generated on
|
393
|
+
Generated on Sun Jan 11 14:20:10 2015 by
|
394
394
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
395
395
|
0.8.7.6 (ruby-2.0.0).
|
396
396
|
</div>
|
data/doc/EZMQ/Socket.html
CHANGED
@@ -112,7 +112,7 @@
|
|
112
112
|
|
113
113
|
</div><div id="subclasses">
|
114
114
|
<h2>Direct Known Subclasses</h2>
|
115
|
-
<p class="children"><span class='object_link'><a href="Client.html" title="EZMQ::Client (class)">Client</a></span>, <span class='object_link'><a href="Publisher.html" title="EZMQ::Publisher (class)">Publisher</a></span>, <span class='object_link'><a href="Server.html" title="EZMQ::Server (class)">Server</a></span>, <span class='object_link'><a href="Subscriber.html" title="EZMQ::Subscriber (class)">Subscriber</a></span></p>
|
115
|
+
<p class="children"><span class='object_link'><a href="Client.html" title="EZMQ::Client (class)">Client</a></span>, <span class='object_link'><a href="Publisher.html" title="EZMQ::Publisher (class)">Publisher</a></span>, <span class='object_link'><a href="Puller.html" title="EZMQ::Puller (class)">Puller</a></span>, <span class='object_link'><a href="Pusher.html" title="EZMQ::Pusher (class)">Pusher</a></span>, <span class='object_link'><a href="Server.html" title="EZMQ::Server (class)">Server</a></span>, <span class='object_link'><a href="Subscriber.html" title="EZMQ::Subscriber (class)">Subscriber</a></span></p>
|
116
116
|
</div>
|
117
117
|
|
118
118
|
|
@@ -313,6 +313,30 @@
|
|
313
313
|
<p>Creates a 0MQ socket.</p>
|
314
314
|
</div></span>
|
315
315
|
|
316
|
+
</li>
|
317
|
+
|
318
|
+
|
319
|
+
<li class="public ">
|
320
|
+
<span class="summary_signature">
|
321
|
+
|
322
|
+
<a href="#listen-instance_method" title="#listen (instance method)">- (void) <strong>listen</strong> {|message| ... }</a>
|
323
|
+
|
324
|
+
|
325
|
+
|
326
|
+
</span>
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
|
331
|
+
|
332
|
+
|
333
|
+
|
334
|
+
|
335
|
+
|
336
|
+
<span class="summary_desc"><div class='inline'>
|
337
|
+
<p>By default, waits for a message and prints it to STDOUT.</p>
|
338
|
+
</div></span>
|
339
|
+
|
316
340
|
</li>
|
317
341
|
|
318
342
|
|
@@ -358,7 +382,7 @@
|
|
358
382
|
|
359
383
|
|
360
384
|
<span class="summary_desc"><div class='inline'>
|
361
|
-
<p>Sends a message
|
385
|
+
<p>Sends a message to the socket.</p>
|
362
386
|
</div></span>
|
363
387
|
|
364
388
|
</li>
|
@@ -385,15 +409,7 @@
|
|
385
409
|
<div class="note notetag">
|
386
410
|
<strong>Note:</strong>
|
387
411
|
<div class='inline'>
|
388
|
-
<p
|
389
|
-
'127.0.0.1'</p>
|
390
|
-
</div>
|
391
|
-
</div>
|
392
|
-
|
393
|
-
<div class="note notetag">
|
394
|
-
<strong>Note:</strong>
|
395
|
-
<div class='inline'>
|
396
|
-
<p>`port` is ignored unless protocol is either 'tcp' or 'udp'.</p>
|
412
|
+
<p>port is ignored unless protocol is either 'tcp' or 'udp'.</p>
|
397
413
|
</div>
|
398
414
|
</div>
|
399
415
|
|
@@ -412,13 +428,13 @@
|
|
412
428
|
<span class='name'>mode</span>
|
413
429
|
|
414
430
|
|
415
|
-
<span class='type'>(<tt
|
431
|
+
<span class='type'>(<tt>:bind</tt>, <tt>:connect</tt>)</span>
|
416
432
|
|
417
433
|
|
418
434
|
|
419
435
|
—
|
420
436
|
<div class='inline'>
|
421
|
-
<p>the mode of the socket
|
437
|
+
<p>the mode of the socket.</p>
|
422
438
|
</div>
|
423
439
|
|
424
440
|
</li>
|
@@ -511,10 +527,13 @@
|
|
511
527
|
<span class="type">(<tt>String</tt>)</span>
|
512
528
|
<span class="default">
|
513
529
|
|
530
|
+
— default:
|
531
|
+
<tt>'tcp'</tt>
|
532
|
+
|
514
533
|
</span>
|
515
534
|
|
516
535
|
— <div class='inline'>
|
517
|
-
<p>protocol
|
536
|
+
<p>protocol for transport.</p>
|
518
537
|
</div>
|
519
538
|
|
520
539
|
</li>
|
@@ -524,10 +543,13 @@
|
|
524
543
|
<span class="type">(<tt>String</tt>)</span>
|
525
544
|
<span class="default">
|
526
545
|
|
546
|
+
— default:
|
547
|
+
<tt>'127.0.0.1'</tt>
|
548
|
+
|
527
549
|
</span>
|
528
550
|
|
529
551
|
— <div class='inline'>
|
530
|
-
<p>address
|
552
|
+
<p>address for endpoint.</p>
|
531
553
|
</div>
|
532
554
|
|
533
555
|
</li>
|
@@ -537,10 +559,13 @@
|
|
537
559
|
<span class="type">(<tt>Fixnum</tt>)</span>
|
538
560
|
<span class="default">
|
539
561
|
|
562
|
+
— default:
|
563
|
+
<tt>5555</tt>
|
564
|
+
|
540
565
|
</span>
|
541
566
|
|
542
567
|
— <div class='inline'>
|
543
|
-
<p>port
|
568
|
+
<p>port for endpoint.</p>
|
544
569
|
</div>
|
545
570
|
|
546
571
|
</li>
|
@@ -555,18 +580,18 @@
|
|
555
580
|
<pre class="lines">
|
556
581
|
|
557
582
|
|
583
|
+
26
|
584
|
+
27
|
585
|
+
28
|
586
|
+
29
|
558
587
|
30
|
559
588
|
31
|
560
589
|
32
|
561
590
|
33
|
562
|
-
34
|
563
|
-
35
|
564
|
-
36
|
565
|
-
37
|
566
|
-
38</pre>
|
591
|
+
34</pre>
|
567
592
|
</td>
|
568
593
|
<td>
|
569
|
-
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line
|
594
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line 26</span>
|
570
595
|
|
571
596
|
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_mode'>mode</span><span class='comma'>,</span> <span class='id identifier rubyid_type'>type</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
572
597
|
<span class='id identifier rubyid_fail'>fail</span> <span class='const'>ArgumentError</span> <span class='kw'>unless</span> <span class='lbracket'>[</span><span class='symbol'>:bind</span><span class='comma'>,</span> <span class='symbol'>:connect</span><span class='rbracket'>]</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='id identifier rubyid_mode'>mode</span>
|
@@ -781,15 +806,15 @@
|
|
781
806
|
<div class="note notetag">
|
782
807
|
<strong>Note:</strong>
|
783
808
|
<div class='inline'>
|
784
|
-
<p
|
785
|
-
'127.0.0.1'
|
809
|
+
<p>An address of 'localhost' is not reliable on all platforms. Prefer
|
810
|
+
'127.0.0.1' instead.</p>
|
786
811
|
</div>
|
787
812
|
</div>
|
788
813
|
|
789
814
|
<div class="note notetag">
|
790
815
|
<strong>Note:</strong>
|
791
816
|
<div class='inline'>
|
792
|
-
<p
|
817
|
+
<p>port is ignored unless protocol is either 'tcp' or 'udp'.</p>
|
793
818
|
</div>
|
794
819
|
</div>
|
795
820
|
|
@@ -814,7 +839,7 @@
|
|
814
839
|
|
815
840
|
—
|
816
841
|
<div class='inline'>
|
817
|
-
<p>
|
842
|
+
<p>('tcp') protocol for transport.</p>
|
818
843
|
</div>
|
819
844
|
|
820
845
|
</li>
|
@@ -830,7 +855,7 @@
|
|
830
855
|
|
831
856
|
—
|
832
857
|
<div class='inline'>
|
833
|
-
<p>
|
858
|
+
<p>('127.0.0.1') address for endpoint.</p>
|
834
859
|
</div>
|
835
860
|
|
836
861
|
</li>
|
@@ -846,7 +871,7 @@
|
|
846
871
|
|
847
872
|
—
|
848
873
|
<div class='inline'>
|
849
|
-
<p>port
|
874
|
+
<p>(5555) port for endpoint.</p>
|
850
875
|
</div>
|
851
876
|
|
852
877
|
</li>
|
@@ -878,14 +903,14 @@
|
|
878
903
|
<pre class="lines">
|
879
904
|
|
880
905
|
|
906
|
+
85
|
907
|
+
86
|
908
|
+
87
|
881
909
|
88
|
882
|
-
89
|
883
|
-
90
|
884
|
-
91
|
885
|
-
92</pre>
|
910
|
+
89</pre>
|
886
911
|
</td>
|
887
912
|
<td>
|
888
|
-
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line
|
913
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line 85</span>
|
889
914
|
|
890
915
|
<span class='kw'>def</span> <span class='id identifier rubyid_bind'>bind</span><span class='lparen'>(</span><span class='label'>protocol:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>tcp</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>address:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>127.0.0.1</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>port:</span> <span class='int'>5555</span><span class='rparen'>)</span>
|
891
916
|
<span class='id identifier rubyid_endpoint'>endpoint</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span> <span class='id identifier rubyid_protocol'>protocol</span> <span class='embexpr_end'>}</span><span class='tstring_content'>://</span><span class='embexpr_beg'>#{</span> <span class='id identifier rubyid_address'>address</span> <span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
@@ -912,7 +937,7 @@
|
|
912
937
|
<div class="note notetag">
|
913
938
|
<strong>Note:</strong>
|
914
939
|
<div class='inline'>
|
915
|
-
<p
|
940
|
+
<p>port is ignored unless protocol is either 'tcp' or 'udp'.</p>
|
916
941
|
</div>
|
917
942
|
</div>
|
918
943
|
|
@@ -937,7 +962,7 @@
|
|
937
962
|
|
938
963
|
—
|
939
964
|
<div class='inline'>
|
940
|
-
<p>
|
965
|
+
<p>('tcp') protocol for transport.</p>
|
941
966
|
</div>
|
942
967
|
|
943
968
|
</li>
|
@@ -953,7 +978,7 @@
|
|
953
978
|
|
954
979
|
—
|
955
980
|
<div class='inline'>
|
956
|
-
<p>
|
981
|
+
<p>('127.0.0.1') address for endpoint.</p>
|
957
982
|
</div>
|
958
983
|
|
959
984
|
</li>
|
@@ -969,7 +994,7 @@
|
|
969
994
|
|
970
995
|
—
|
971
996
|
<div class='inline'>
|
972
|
-
<p>port
|
997
|
+
<p>(5555) port for endpoint.</p>
|
973
998
|
</div>
|
974
999
|
|
975
1000
|
</li>
|
@@ -1001,14 +1026,14 @@
|
|
1001
1026
|
<pre class="lines">
|
1002
1027
|
|
1003
1028
|
|
1029
|
+
100
|
1030
|
+
101
|
1031
|
+
102
|
1004
1032
|
103
|
1005
|
-
104
|
1006
|
-
105
|
1007
|
-
106
|
1008
|
-
107</pre>
|
1033
|
+
104</pre>
|
1009
1034
|
</td>
|
1010
1035
|
<td>
|
1011
|
-
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line
|
1036
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line 100</span>
|
1012
1037
|
|
1013
1038
|
<span class='kw'>def</span> <span class='id identifier rubyid_connect'>connect</span><span class='lparen'>(</span><span class='label'>protocol:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>tcp</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>address:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>127.0.0.1</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>port:</span> <span class='int'>5555</span><span class='rparen'>)</span>
|
1014
1039
|
<span class='id identifier rubyid_endpoint'>endpoint</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='embexpr_beg'>#{</span> <span class='id identifier rubyid_protocol'>protocol</span> <span class='embexpr_end'>}</span><span class='tstring_content'>://</span><span class='embexpr_beg'>#{</span> <span class='id identifier rubyid_address'>address</span> <span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
@@ -1018,6 +1043,97 @@
|
|
1018
1043
|
</td>
|
1019
1044
|
</tr>
|
1020
1045
|
</table>
|
1046
|
+
</div>
|
1047
|
+
|
1048
|
+
<div class="method_details ">
|
1049
|
+
<h3 class="signature " id="listen-instance_method">
|
1050
|
+
|
1051
|
+
- (<tt>void</tt>) <strong>listen</strong> {|message| ... }
|
1052
|
+
|
1053
|
+
|
1054
|
+
|
1055
|
+
|
1056
|
+
|
1057
|
+
</h3><div class="docstring">
|
1058
|
+
<div class="discussion">
|
1059
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
1060
|
+
<p>By default, waits for a message and prints it to STDOUT.</p>
|
1061
|
+
|
1062
|
+
|
1063
|
+
</div>
|
1064
|
+
</div>
|
1065
|
+
<div class="tags">
|
1066
|
+
|
1067
|
+
<p class="tag_title">Yields:</p>
|
1068
|
+
<ul class="yield">
|
1069
|
+
|
1070
|
+
<li>
|
1071
|
+
|
1072
|
+
|
1073
|
+
<span class='type'></span>
|
1074
|
+
|
1075
|
+
|
1076
|
+
|
1077
|
+
|
1078
|
+
<div class='inline'>
|
1079
|
+
<p>message passes the message received to the block.</p>
|
1080
|
+
</div>
|
1081
|
+
|
1082
|
+
</li>
|
1083
|
+
|
1084
|
+
</ul>
|
1085
|
+
<p class="tag_title">Yield Parameters:</p>
|
1086
|
+
<ul class="yieldparam">
|
1087
|
+
|
1088
|
+
<li>
|
1089
|
+
|
1090
|
+
<span class='name'>message</span>
|
1091
|
+
|
1092
|
+
|
1093
|
+
<span class='type'>(<tt>String</tt>)</span>
|
1094
|
+
|
1095
|
+
|
1096
|
+
|
1097
|
+
—
|
1098
|
+
<div class='inline'>
|
1099
|
+
<p>the message received.</p>
|
1100
|
+
</div>
|
1101
|
+
|
1102
|
+
</li>
|
1103
|
+
|
1104
|
+
</ul>
|
1105
|
+
|
1106
|
+
</div><table class="source_code">
|
1107
|
+
<tr>
|
1108
|
+
<td>
|
1109
|
+
<pre class="lines">
|
1110
|
+
|
1111
|
+
|
1112
|
+
113
|
1113
|
+
114
|
1114
|
+
115
|
1115
|
+
116
|
1116
|
+
117
|
1117
|
+
118
|
1118
|
+
119
|
1119
|
+
120
|
1120
|
+
121</pre>
|
1121
|
+
</td>
|
1122
|
+
<td>
|
1123
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line 113</span>
|
1124
|
+
|
1125
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_listen'>listen</span>
|
1126
|
+
<span class='id identifier rubyid_loop'>loop</span> <span class='kw'>do</span>
|
1127
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
|
1128
|
+
<span class='kw'>yield</span> <span class='id identifier rubyid_receive'>receive</span>
|
1129
|
+
<span class='kw'>else</span>
|
1130
|
+
<span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_receive'>receive</span>
|
1131
|
+
<span class='kw'>end</span>
|
1132
|
+
<span class='kw'>end</span>
|
1133
|
+
<span class='kw'>end</span></pre>
|
1134
|
+
</td>
|
1135
|
+
</tr>
|
1136
|
+
</table>
|
1021
1137
|
</div>
|
1022
1138
|
|
1023
1139
|
<div class="method_details ">
|
@@ -1152,19 +1268,19 @@
|
|
1152
1268
|
<pre class="lines">
|
1153
1269
|
|
1154
1270
|
|
1271
|
+
63
|
1272
|
+
64
|
1273
|
+
65
|
1274
|
+
66
|
1155
1275
|
67
|
1156
1276
|
68
|
1157
1277
|
69
|
1158
1278
|
70
|
1159
1279
|
71
|
1160
|
-
72
|
1161
|
-
73
|
1162
|
-
74
|
1163
|
-
75
|
1164
|
-
76</pre>
|
1280
|
+
72</pre>
|
1165
1281
|
</td>
|
1166
1282
|
<td>
|
1167
|
-
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line
|
1283
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line 63</span>
|
1168
1284
|
|
1169
1285
|
<span class='kw'>def</span> <span class='id identifier rubyid_receive'>receive</span><span class='lparen'>(</span><span class='op'>**</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
1170
1286
|
<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>
|
@@ -1196,12 +1312,12 @@
|
|
1196
1312
|
<div class="note notetag">
|
1197
1313
|
<strong>Note:</strong>
|
1198
1314
|
<div class='inline'>
|
1199
|
-
<p>If
|
1315
|
+
<p>If message is not a String, #encode must convert it to one.</p>
|
1200
1316
|
</div>
|
1201
1317
|
</div>
|
1202
1318
|
|
1203
1319
|
|
1204
|
-
<p>Sends a message
|
1320
|
+
<p>Sends a message to the socket.</p>
|
1205
1321
|
|
1206
1322
|
|
1207
1323
|
</div>
|
@@ -1295,13 +1411,13 @@
|
|
1295
1411
|
<pre class="lines">
|
1296
1412
|
|
1297
1413
|
|
1298
|
-
|
1299
|
-
|
1300
|
-
|
1301
|
-
|
1414
|
+
46
|
1415
|
+
47
|
1416
|
+
48
|
1417
|
+
49</pre>
|
1302
1418
|
</td>
|
1303
1419
|
<td>
|
1304
|
-
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line
|
1420
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line 46</span>
|
1305
1421
|
|
1306
1422
|
<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='op'>**</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
1307
1423
|
<span class='id identifier rubyid_encoded'>encoded</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:encode</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='ivar'>@encode</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span> <span class='id identifier rubyid_message'>message</span>
|
@@ -1317,7 +1433,7 @@
|
|
1317
1433
|
</div>
|
1318
1434
|
|
1319
1435
|
<div id="footer">
|
1320
|
-
Generated on
|
1436
|
+
Generated on Sun Jan 11 14:20:10 2015 by
|
1321
1437
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1322
1438
|
0.8.7.6 (ruby-2.0.0).
|
1323
1439
|
</div>
|