ezmq 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/EZMQ.html +4 -2
- data/doc/EZMQ/Client.html +15 -15
- data/doc/EZMQ/Publisher.html +10 -10
- data/doc/EZMQ/Puller.html +6 -6
- data/doc/EZMQ/Pusher.html +6 -6
- data/doc/EZMQ/Server.html +16 -16
- data/doc/EZMQ/Socket.html +42 -42
- data/doc/EZMQ/Subscriber.html +361 -21
- data/doc/_index.html +1 -1
- data/doc/file.README.html +7 -3
- data/doc/index.html +7 -3
- data/doc/method_list.html +23 -11
- data/doc/top-level-namespace.html +1 -1
- data/ezmq.gemspec +1 -1
- data/lib/ezmq/subscribe.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50909d1a3f0ca593c2047c46913f907e3eb6508b
|
4
|
+
data.tar.gz: 59c18022fe8978afc77618f17ea04cd77e34bb63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 269df5c561b3e46e8dab505ca8f149adf746909ab2e4d971441f645ee98444180641fd510b28e30a954c97a43df339072e6463d70d67070bda4313a5d29bab00
|
7
|
+
data.tar.gz: b09e72c835f7483c226a7c77a1cc74b3df303748d756473e82861be35bc0b497854d4f07061e76f1ba28d73e9b6f3d5ff346664514cec21331536ee095267f09
|
data/doc/EZMQ.html
CHANGED
@@ -79,7 +79,9 @@
|
|
79
79
|
|
80
80
|
|
81
81
|
<dt class="r1 last">Defined in:</dt>
|
82
|
-
<dd class="r1 last">lib/ezmq.rb
|
82
|
+
<dd class="r1 last">lib/ezmq/pull.rb<span class="defines">,<br />
|
83
|
+
lib/ezmq/push.rb,<br /> lib/ezmq/reply.rb,<br /> lib/ezmq/socket.rb,<br /> lib/ezmq/request.rb,<br /> lib/ezmq/publish.rb,<br /> lib/ezmq/subscribe.rb</span>
|
84
|
+
</dd>
|
83
85
|
|
84
86
|
</dl>
|
85
87
|
<div class="clear"></div>
|
@@ -117,7 +119,7 @@
|
|
117
119
|
</div>
|
118
120
|
|
119
121
|
<div id="footer">
|
120
|
-
Generated on
|
122
|
+
Generated on Tue Jan 20 23:17:34 2015 by
|
121
123
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
122
124
|
0.8.7.6 (ruby-2.0.0).
|
123
125
|
</div>
|
data/doc/EZMQ/Client.html
CHANGED
@@ -96,7 +96,7 @@
|
|
96
96
|
|
97
97
|
|
98
98
|
<dt class="r2 last">Defined in:</dt>
|
99
|
-
<dd class="r2 last">lib/ezmq.rb</dd>
|
99
|
+
<dd class="r2 last">lib/ezmq/request.rb</dd>
|
100
100
|
|
101
101
|
</dl>
|
102
102
|
<div class="clear"></div>
|
@@ -252,12 +252,12 @@
|
|
252
252
|
<pre class="lines">
|
253
253
|
|
254
254
|
|
255
|
-
|
256
|
-
|
257
|
-
|
255
|
+
14
|
256
|
+
15
|
257
|
+
16</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/request.rb', line 14</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'>:connect</span><span class='comma'>,</span> <span class='const'>ZMQ</span><span class='op'>::</span><span class='const'>REQ</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span>
|
@@ -375,17 +375,17 @@
|
|
375
375
|
<pre class="lines">
|
376
376
|
|
377
377
|
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
378
|
+
27
|
379
|
+
28
|
380
|
+
29
|
381
|
+
30
|
382
|
+
31
|
383
|
+
32
|
384
|
+
33
|
385
|
+
34</pre>
|
386
386
|
</td>
|
387
387
|
<td>
|
388
|
-
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line
|
388
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq/request.rb', line 27</span>
|
389
389
|
|
390
390
|
<span class='kw'>def</span> <span class='id identifier rubyid_request'>request</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>
|
391
391
|
<span class='id identifier rubyid_send'>send</span> <span class='id identifier rubyid_message'>message</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span>
|
@@ -405,7 +405,7 @@
|
|
405
405
|
</div>
|
406
406
|
|
407
407
|
<div id="footer">
|
408
|
-
Generated on
|
408
|
+
Generated on Tue Jan 20 23:17:35 2015 by
|
409
409
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
410
410
|
0.8.7.6 (ruby-2.0.0).
|
411
411
|
</div>
|
data/doc/EZMQ/Publisher.html
CHANGED
@@ -96,7 +96,7 @@
|
|
96
96
|
|
97
97
|
|
98
98
|
<dt class="r2 last">Defined in:</dt>
|
99
|
-
<dd class="r2 last">lib/ezmq.rb</dd>
|
99
|
+
<dd class="r2 last">lib/ezmq/publish.rb</dd>
|
100
100
|
|
101
101
|
</dl>
|
102
102
|
<div class="clear"></div>
|
@@ -252,12 +252,12 @@
|
|
252
252
|
<pre class="lines">
|
253
253
|
|
254
254
|
|
255
|
-
|
256
|
-
|
257
|
-
|
255
|
+
14
|
256
|
+
15
|
257
|
+
16</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/publish.rb', line 14</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'>PUB</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span>
|
@@ -398,12 +398,12 @@
|
|
398
398
|
<pre class="lines">
|
399
399
|
|
400
400
|
|
401
|
-
|
402
|
-
|
403
|
-
|
401
|
+
27
|
402
|
+
28
|
403
|
+
29</pre>
|
404
404
|
</td>
|
405
405
|
<td>
|
406
|
-
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line
|
406
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq/publish.rb', line 27</span>
|
407
407
|
|
408
408
|
<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='op'>**</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
409
409
|
<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='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> <span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
@@ -418,7 +418,7 @@
|
|
418
418
|
</div>
|
419
419
|
|
420
420
|
<div id="footer">
|
421
|
-
Generated on
|
421
|
+
Generated on Tue Jan 20 23:17:35 2015 by
|
422
422
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
423
423
|
0.8.7.6 (ruby-2.0.0).
|
424
424
|
</div>
|
data/doc/EZMQ/Puller.html
CHANGED
@@ -96,7 +96,7 @@
|
|
96
96
|
|
97
97
|
|
98
98
|
<dt class="r2 last">Defined in:</dt>
|
99
|
-
<dd class="r2 last">lib/ezmq.rb</dd>
|
99
|
+
<dd class="r2 last">lib/ezmq/pull.rb</dd>
|
100
100
|
|
101
101
|
</dl>
|
102
102
|
<div class="clear"></div>
|
@@ -246,12 +246,12 @@
|
|
246
246
|
<pre class="lines">
|
247
247
|
|
248
248
|
|
249
|
-
|
250
|
-
|
251
|
-
|
249
|
+
15
|
250
|
+
16
|
251
|
+
17</pre>
|
252
252
|
</td>
|
253
253
|
<td>
|
254
|
-
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line
|
254
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq/pull.rb', line 15</span>
|
255
255
|
|
256
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'>:bind</span><span class='comma'>,</span> <span class='op'>**</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
257
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'>PULL</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span>
|
@@ -267,7 +267,7 @@
|
|
267
267
|
</div>
|
268
268
|
|
269
269
|
<div id="footer">
|
270
|
-
Generated on
|
270
|
+
Generated on Tue Jan 20 23:17:34 2015 by
|
271
271
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
272
272
|
0.8.7.6 (ruby-2.0.0).
|
273
273
|
</div>
|
data/doc/EZMQ/Pusher.html
CHANGED
@@ -96,7 +96,7 @@
|
|
96
96
|
|
97
97
|
|
98
98
|
<dt class="r2 last">Defined in:</dt>
|
99
|
-
<dd class="r2 last">lib/ezmq.rb</dd>
|
99
|
+
<dd class="r2 last">lib/ezmq/push.rb</dd>
|
100
100
|
|
101
101
|
</dl>
|
102
102
|
<div class="clear"></div>
|
@@ -246,12 +246,12 @@
|
|
246
246
|
<pre class="lines">
|
247
247
|
|
248
248
|
|
249
|
-
|
250
|
-
|
251
|
-
|
249
|
+
15
|
250
|
+
16
|
251
|
+
17</pre>
|
252
252
|
</td>
|
253
253
|
<td>
|
254
|
-
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line
|
254
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq/push.rb', line 15</span>
|
255
255
|
|
256
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
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>
|
@@ -267,7 +267,7 @@
|
|
267
267
|
</div>
|
268
268
|
|
269
269
|
<div id="footer">
|
270
|
-
Generated on
|
270
|
+
Generated on Tue Jan 20 23:17:34 2015 by
|
271
271
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
272
272
|
0.8.7.6 (ruby-2.0.0).
|
273
273
|
</div>
|
data/doc/EZMQ/Server.html
CHANGED
@@ -96,7 +96,7 @@
|
|
96
96
|
|
97
97
|
|
98
98
|
<dt class="r2 last">Defined in:</dt>
|
99
|
-
<dd class="r2 last">lib/ezmq.rb</dd>
|
99
|
+
<dd class="r2 last">lib/ezmq/reply.rb</dd>
|
100
100
|
|
101
101
|
</dl>
|
102
102
|
<div class="clear"></div>
|
@@ -252,12 +252,12 @@
|
|
252
252
|
<pre class="lines">
|
253
253
|
|
254
254
|
|
255
|
-
|
256
|
-
|
257
|
-
|
255
|
+
15
|
256
|
+
16
|
257
|
+
17</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/reply.rb', line 15</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
|
+
29
|
362
|
+
30
|
363
|
+
31
|
364
|
+
32
|
365
|
+
33
|
366
|
+
34
|
367
|
+
35
|
368
|
+
36
|
369
|
+
37</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/reply.rb', line 29</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 Tue Jan 20 23:17:35 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
@@ -94,7 +94,7 @@
|
|
94
94
|
|
95
95
|
|
96
96
|
<dt class="r2 last">Defined in:</dt>
|
97
|
-
<dd class="r2 last">lib/ezmq.rb</dd>
|
97
|
+
<dd class="r2 last">lib/ezmq/socket.rb</dd>
|
98
98
|
|
99
99
|
</dl>
|
100
100
|
<div class="clear"></div>
|
@@ -580,18 +580,18 @@
|
|
580
580
|
<pre class="lines">
|
581
581
|
|
582
582
|
|
583
|
+
24
|
584
|
+
25
|
583
585
|
26
|
584
586
|
27
|
585
587
|
28
|
586
588
|
29
|
587
589
|
30
|
588
590
|
31
|
589
|
-
32
|
590
|
-
33
|
591
|
-
34</pre>
|
591
|
+
32</pre>
|
592
592
|
</td>
|
593
593
|
<td>
|
594
|
-
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line
|
594
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq/socket.rb', line 24</span>
|
595
595
|
|
596
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>
|
597
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>
|
@@ -640,12 +640,12 @@
|
|
640
640
|
<pre class="lines">
|
641
641
|
|
642
642
|
|
643
|
-
|
644
|
-
|
645
|
-
|
643
|
+
5
|
644
|
+
6
|
645
|
+
7</pre>
|
646
646
|
</td>
|
647
647
|
<td>
|
648
|
-
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line
|
648
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq/socket.rb', line 5</span>
|
649
649
|
|
650
650
|
<span class='kw'>def</span> <span class='id identifier rubyid_context'>context</span>
|
651
651
|
<span class='ivar'>@context</span>
|
@@ -683,12 +683,12 @@
|
|
683
683
|
<pre class="lines">
|
684
684
|
|
685
685
|
|
686
|
-
|
687
|
-
|
688
|
-
|
686
|
+
5
|
687
|
+
6
|
688
|
+
7</pre>
|
689
689
|
</td>
|
690
690
|
<td>
|
691
|
-
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line
|
691
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq/socket.rb', line 5</span>
|
692
692
|
|
693
693
|
<span class='kw'>def</span> <span class='id identifier rubyid_decode'>decode</span>
|
694
694
|
<span class='ivar'>@decode</span>
|
@@ -726,12 +726,12 @@
|
|
726
726
|
<pre class="lines">
|
727
727
|
|
728
728
|
|
729
|
-
|
730
|
-
|
731
|
-
|
729
|
+
5
|
730
|
+
6
|
731
|
+
7</pre>
|
732
732
|
</td>
|
733
733
|
<td>
|
734
|
-
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line
|
734
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq/socket.rb', line 5</span>
|
735
735
|
|
736
736
|
<span class='kw'>def</span> <span class='id identifier rubyid_encode'>encode</span>
|
737
737
|
<span class='ivar'>@encode</span>
|
@@ -769,12 +769,12 @@
|
|
769
769
|
<pre class="lines">
|
770
770
|
|
771
771
|
|
772
|
-
|
773
|
-
|
774
|
-
|
772
|
+
5
|
773
|
+
6
|
774
|
+
7</pre>
|
775
775
|
</td>
|
776
776
|
<td>
|
777
|
-
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line
|
777
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq/socket.rb', line 5</span>
|
778
778
|
|
779
779
|
<span class='kw'>def</span> <span class='id identifier rubyid_socket'>socket</span>
|
780
780
|
<span class='ivar'>@socket</span>
|
@@ -903,14 +903,14 @@
|
|
903
903
|
<pre class="lines">
|
904
904
|
|
905
905
|
|
906
|
+
83
|
907
|
+
84
|
906
908
|
85
|
907
909
|
86
|
908
|
-
87
|
909
|
-
88
|
910
|
-
89</pre>
|
910
|
+
87</pre>
|
911
911
|
</td>
|
912
912
|
<td>
|
913
|
-
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line
|
913
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq/socket.rb', line 83</span>
|
914
914
|
|
915
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>
|
916
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>
|
@@ -1026,14 +1026,14 @@
|
|
1026
1026
|
<pre class="lines">
|
1027
1027
|
|
1028
1028
|
|
1029
|
+
98
|
1030
|
+
99
|
1029
1031
|
100
|
1030
1032
|
101
|
1031
|
-
102
|
1032
|
-
103
|
1033
|
-
104</pre>
|
1033
|
+
102</pre>
|
1034
1034
|
</td>
|
1035
1035
|
<td>
|
1036
|
-
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line
|
1036
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq/socket.rb', line 98</span>
|
1037
1037
|
|
1038
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>
|
1039
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>
|
@@ -1109,18 +1109,18 @@
|
|
1109
1109
|
<pre class="lines">
|
1110
1110
|
|
1111
1111
|
|
1112
|
+
111
|
1113
|
+
112
|
1112
1114
|
113
|
1113
1115
|
114
|
1114
1116
|
115
|
1115
1117
|
116
|
1116
1118
|
117
|
1117
1119
|
118
|
1118
|
-
119
|
1119
|
-
120
|
1120
|
-
121</pre>
|
1120
|
+
119</pre>
|
1121
1121
|
</td>
|
1122
1122
|
<td>
|
1123
|
-
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line
|
1123
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq/socket.rb', line 111</span>
|
1124
1124
|
|
1125
1125
|
<span class='kw'>def</span> <span class='id identifier rubyid_listen'>listen</span>
|
1126
1126
|
<span class='id identifier rubyid_loop'>loop</span> <span class='kw'>do</span>
|
@@ -1268,6 +1268,8 @@
|
|
1268
1268
|
<pre class="lines">
|
1269
1269
|
|
1270
1270
|
|
1271
|
+
61
|
1272
|
+
62
|
1271
1273
|
63
|
1272
1274
|
64
|
1273
1275
|
65
|
@@ -1275,12 +1277,10 @@
|
|
1275
1277
|
67
|
1276
1278
|
68
|
1277
1279
|
69
|
1278
|
-
70
|
1279
|
-
71
|
1280
|
-
72</pre>
|
1280
|
+
70</pre>
|
1281
1281
|
</td>
|
1282
1282
|
<td>
|
1283
|
-
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line
|
1283
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq/socket.rb', line 61</span>
|
1284
1284
|
|
1285
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>
|
1286
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>
|
@@ -1411,13 +1411,13 @@
|
|
1411
1411
|
<pre class="lines">
|
1412
1412
|
|
1413
1413
|
|
1414
|
+
44
|
1415
|
+
45
|
1414
1416
|
46
|
1415
|
-
47
|
1416
|
-
48
|
1417
|
-
49</pre>
|
1417
|
+
47</pre>
|
1418
1418
|
</td>
|
1419
1419
|
<td>
|
1420
|
-
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line
|
1420
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq/socket.rb', line 44</span>
|
1421
1421
|
|
1422
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>
|
1423
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>
|
@@ -1433,7 +1433,7 @@
|
|
1433
1433
|
</div>
|
1434
1434
|
|
1435
1435
|
<div id="footer">
|
1436
|
-
Generated on
|
1436
|
+
Generated on Tue Jan 20 23:17:35 2015 by
|
1437
1437
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
1438
1438
|
0.8.7.6 (ruby-2.0.0).
|
1439
1439
|
</div>
|
data/doc/EZMQ/Subscriber.html
CHANGED
@@ -96,7 +96,7 @@
|
|
96
96
|
|
97
97
|
|
98
98
|
<dt class="r2 last">Defined in:</dt>
|
99
|
-
<dd class="r2 last">lib/ezmq.rb</dd>
|
99
|
+
<dd class="r2 last">lib/ezmq/subscribe.rb</dd>
|
100
100
|
|
101
101
|
</dl>
|
102
102
|
<div class="clear"></div>
|
@@ -187,6 +187,54 @@
|
|
187
187
|
<p>Creates a new Subscriber socket.</p>
|
188
188
|
</div></span>
|
189
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> {|message, topic| ... }</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 for a message and prints it to STDOUT.</p>
|
212
|
+
</div></span>
|
213
|
+
|
214
|
+
</li>
|
215
|
+
|
216
|
+
|
217
|
+
<li class="public ">
|
218
|
+
<span class="summary_signature">
|
219
|
+
|
220
|
+
<a href="#receive-instance_method" title="#receive (instance method)">- (Object) <strong>receive</strong>(**options) {|message, topic| ... }</a>
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
</span>
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
<span class="summary_desc"><div class='inline'>
|
235
|
+
<p>Receive a message from the socket.</p>
|
236
|
+
</div></span>
|
237
|
+
|
190
238
|
</li>
|
191
239
|
|
192
240
|
|
@@ -251,7 +299,7 @@
|
|
251
299
|
|
252
300
|
|
253
301
|
<h3 class="inherited">Methods inherited from <span class='object_link'><a href="Socket.html" title="EZMQ::Socket (class)">Socket</a></span></h3>
|
254
|
-
<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#
|
302
|
+
<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#send-instance_method" title="EZMQ::Socket#send (method)">#send</a></span></p>
|
255
303
|
<div id="constructor_details" class="method_details_list">
|
256
304
|
<h2>Constructor Details</h2>
|
257
305
|
|
@@ -338,13 +386,13 @@
|
|
338
386
|
<pre class="lines">
|
339
387
|
|
340
388
|
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
389
|
+
19
|
390
|
+
20
|
391
|
+
21
|
392
|
+
22</pre>
|
345
393
|
</td>
|
346
394
|
<td>
|
347
|
-
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line
|
395
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq/subscribe.rb', line 19</span>
|
348
396
|
|
349
397
|
<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>
|
350
398
|
<span class='kw'>super</span> <span class='symbol'>:connect</span><span class='comma'>,</span> <span class='const'>ZMQ</span><span class='op'>::</span><span class='const'>SUB</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span>
|
@@ -388,12 +436,12 @@
|
|
388
436
|
<pre class="lines">
|
389
437
|
|
390
438
|
|
391
|
-
|
392
|
-
|
393
|
-
|
439
|
+
7
|
440
|
+
8
|
441
|
+
9</pre>
|
394
442
|
</td>
|
395
443
|
<td>
|
396
|
-
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line
|
444
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq/subscribe.rb', line 7</span>
|
397
445
|
|
398
446
|
<span class='kw'>def</span> <span class='id identifier rubyid_action'>action</span>
|
399
447
|
<span class='ivar'>@action</span>
|
@@ -411,7 +459,299 @@
|
|
411
459
|
|
412
460
|
|
413
461
|
<div class="method_details first">
|
414
|
-
<h3 class="signature first" id="
|
462
|
+
<h3 class="signature first" id="listen-instance_method">
|
463
|
+
|
464
|
+
- (<tt>void</tt>) <strong>listen</strong> {|message, topic| ... }
|
465
|
+
|
466
|
+
|
467
|
+
|
468
|
+
|
469
|
+
|
470
|
+
</h3><div class="docstring">
|
471
|
+
<div class="discussion">
|
472
|
+
<p class="note returns_void">This method returns an undefined value.</p>
|
473
|
+
<p>By default, waits for a message and prints it to STDOUT.</p>
|
474
|
+
|
475
|
+
|
476
|
+
</div>
|
477
|
+
</div>
|
478
|
+
<div class="tags">
|
479
|
+
|
480
|
+
<p class="tag_title">Yields:</p>
|
481
|
+
<ul class="yield">
|
482
|
+
|
483
|
+
<li>
|
484
|
+
|
485
|
+
|
486
|
+
<span class='type'>(<tt>message</tt>, <tt>topic</tt>)</span>
|
487
|
+
|
488
|
+
|
489
|
+
|
490
|
+
—
|
491
|
+
<div class='inline'>
|
492
|
+
<p>passes the message body and topic to the block.</p>
|
493
|
+
</div>
|
494
|
+
|
495
|
+
</li>
|
496
|
+
|
497
|
+
</ul>
|
498
|
+
<p class="tag_title">Yield Parameters:</p>
|
499
|
+
<ul class="yieldparam">
|
500
|
+
|
501
|
+
<li>
|
502
|
+
|
503
|
+
<span class='name'>message</span>
|
504
|
+
|
505
|
+
|
506
|
+
<span class='type'>(<tt>String</tt>)</span>
|
507
|
+
|
508
|
+
|
509
|
+
|
510
|
+
—
|
511
|
+
<div class='inline'>
|
512
|
+
<p>the message received.</p>
|
513
|
+
</div>
|
514
|
+
|
515
|
+
</li>
|
516
|
+
|
517
|
+
<li>
|
518
|
+
|
519
|
+
<span class='name'>topic</span>
|
520
|
+
|
521
|
+
|
522
|
+
<span class='type'>(<tt>String</tt>)</span>
|
523
|
+
|
524
|
+
|
525
|
+
|
526
|
+
—
|
527
|
+
<div class='inline'>
|
528
|
+
<p>the topic of the message.</p>
|
529
|
+
</div>
|
530
|
+
|
531
|
+
</li>
|
532
|
+
|
533
|
+
</ul>
|
534
|
+
|
535
|
+
</div><table class="source_code">
|
536
|
+
<tr>
|
537
|
+
<td>
|
538
|
+
<pre class="lines">
|
539
|
+
|
540
|
+
|
541
|
+
59
|
542
|
+
60
|
543
|
+
61
|
544
|
+
62
|
545
|
+
63
|
546
|
+
64
|
547
|
+
65
|
548
|
+
66
|
549
|
+
67
|
550
|
+
68</pre>
|
551
|
+
</td>
|
552
|
+
<td>
|
553
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq/subscribe.rb', line 59</span>
|
554
|
+
|
555
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_listen'>listen</span>
|
556
|
+
<span class='id identifier rubyid_loop'>loop</span> <span class='kw'>do</span>
|
557
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
|
558
|
+
<span class='kw'>yield</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_receive'>receive</span><span class='rparen'>)</span>
|
559
|
+
<span class='kw'>else</span>
|
560
|
+
<span class='id identifier rubyid_message'>message</span><span class='comma'>,</span> <span class='id identifier rubyid_topic'>topic</span> <span class='op'>=</span> <span class='id identifier rubyid_receive'>receive</span>
|
561
|
+
<span class='id identifier rubyid_puts'>puts</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_message'>message</span> <span class='embexpr_end'>}</span><span class='tstring_end'>"</span></span>
|
562
|
+
<span class='kw'>end</span>
|
563
|
+
<span class='kw'>end</span>
|
564
|
+
<span class='kw'>end</span></pre>
|
565
|
+
</td>
|
566
|
+
</tr>
|
567
|
+
</table>
|
568
|
+
</div>
|
569
|
+
|
570
|
+
<div class="method_details ">
|
571
|
+
<h3 class="signature " id="receive-instance_method">
|
572
|
+
|
573
|
+
- (<tt>Object</tt>) <strong>receive</strong>(**options) {|message, topic| ... }
|
574
|
+
|
575
|
+
|
576
|
+
|
577
|
+
|
578
|
+
|
579
|
+
</h3><div class="docstring">
|
580
|
+
<div class="discussion">
|
581
|
+
|
582
|
+
<div class="note notetag">
|
583
|
+
<strong>Note:</strong>
|
584
|
+
<div class='inline'>
|
585
|
+
<p>This method blocks until a message arrives.</p>
|
586
|
+
</div>
|
587
|
+
</div>
|
588
|
+
|
589
|
+
|
590
|
+
<p>Receive a message from the socket.</p>
|
591
|
+
|
592
|
+
|
593
|
+
</div>
|
594
|
+
</div>
|
595
|
+
<div class="tags">
|
596
|
+
<p class="tag_title">Parameters:</p>
|
597
|
+
<ul class="param">
|
598
|
+
|
599
|
+
<li>
|
600
|
+
|
601
|
+
<span class='name'>options</span>
|
602
|
+
|
603
|
+
|
604
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
605
|
+
|
606
|
+
|
607
|
+
|
608
|
+
—
|
609
|
+
<div class='inline'>
|
610
|
+
<p>optional parameters.</p>
|
611
|
+
</div>
|
612
|
+
|
613
|
+
</li>
|
614
|
+
|
615
|
+
</ul>
|
616
|
+
|
617
|
+
|
618
|
+
|
619
|
+
|
620
|
+
<p class="tag_title">Options Hash (<tt>**options</tt>):</p>
|
621
|
+
<ul class="option">
|
622
|
+
|
623
|
+
<li>
|
624
|
+
<span class="name">decode</span>
|
625
|
+
<span class="type">(<tt>lambda</tt>)</span>
|
626
|
+
<span class="default">
|
627
|
+
|
628
|
+
</span>
|
629
|
+
|
630
|
+
— <div class='inline'>
|
631
|
+
<p>how to decode the message.</p>
|
632
|
+
</div>
|
633
|
+
|
634
|
+
</li>
|
635
|
+
|
636
|
+
</ul>
|
637
|
+
|
638
|
+
|
639
|
+
<p class="tag_title">Yields:</p>
|
640
|
+
<ul class="yield">
|
641
|
+
|
642
|
+
<li>
|
643
|
+
|
644
|
+
|
645
|
+
<span class='type'>(<tt>message</tt>, <tt>topic</tt>)</span>
|
646
|
+
|
647
|
+
|
648
|
+
|
649
|
+
—
|
650
|
+
<div class='inline'>
|
651
|
+
<p>passes the message body and topic to the block.</p>
|
652
|
+
</div>
|
653
|
+
|
654
|
+
</li>
|
655
|
+
|
656
|
+
</ul>
|
657
|
+
<p class="tag_title">Yield Parameters:</p>
|
658
|
+
<ul class="yieldparam">
|
659
|
+
|
660
|
+
<li>
|
661
|
+
|
662
|
+
<span class='name'>message</span>
|
663
|
+
|
664
|
+
|
665
|
+
<span class='type'>(<tt>Object</tt>)</span>
|
666
|
+
|
667
|
+
|
668
|
+
|
669
|
+
—
|
670
|
+
<div class='inline'>
|
671
|
+
<p>the message received (decoded).</p>
|
672
|
+
</div>
|
673
|
+
|
674
|
+
</li>
|
675
|
+
|
676
|
+
<li>
|
677
|
+
|
678
|
+
<span class='name'>topic</span>
|
679
|
+
|
680
|
+
|
681
|
+
<span class='type'>(<tt>String</tt>)</span>
|
682
|
+
|
683
|
+
|
684
|
+
|
685
|
+
—
|
686
|
+
<div class='inline'>
|
687
|
+
<p>the topic of the message.</p>
|
688
|
+
</div>
|
689
|
+
|
690
|
+
</li>
|
691
|
+
|
692
|
+
</ul>
|
693
|
+
<p class="tag_title">Returns:</p>
|
694
|
+
<ul class="return">
|
695
|
+
|
696
|
+
<li>
|
697
|
+
|
698
|
+
|
699
|
+
<span class='type'>(<tt>Object</tt>)</span>
|
700
|
+
|
701
|
+
|
702
|
+
|
703
|
+
—
|
704
|
+
<div class='inline'>
|
705
|
+
<p>the message received (decoded).</p>
|
706
|
+
</div>
|
707
|
+
|
708
|
+
</li>
|
709
|
+
|
710
|
+
</ul>
|
711
|
+
|
712
|
+
</div><table class="source_code">
|
713
|
+
<tr>
|
714
|
+
<td>
|
715
|
+
<pre class="lines">
|
716
|
+
|
717
|
+
|
718
|
+
37
|
719
|
+
38
|
720
|
+
39
|
721
|
+
40
|
722
|
+
41
|
723
|
+
42
|
724
|
+
43
|
725
|
+
44
|
726
|
+
45
|
727
|
+
46
|
728
|
+
47
|
729
|
+
48
|
730
|
+
49</pre>
|
731
|
+
</td>
|
732
|
+
<td>
|
733
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq/subscribe.rb', line 37</span>
|
734
|
+
|
735
|
+
<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>
|
736
|
+
<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>
|
737
|
+
<span class='ivar'>@socket</span><span class='period'>.</span><span class='id identifier rubyid_recv_string'>recv_string</span> <span class='id identifier rubyid_message'>message</span>
|
738
|
+
|
739
|
+
<span class='id identifier rubyid_message'>message</span> <span class='op'>=</span> <span class='id identifier rubyid_message'>message</span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^(?<topic>[^\ ]*)\ (?<body>.*)</span><span class='regexp_end'>/</span></span><span class='rparen'>)</span>
|
740
|
+
|
741
|
+
<span class='id identifier rubyid_decoded'>decoded</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:decode</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='ivar'>@decode</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><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>body</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
742
|
+
<span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
|
743
|
+
<span class='kw'>yield</span> <span class='id identifier rubyid_decoded'>decoded</span><span class='comma'>,</span> <span class='id identifier rubyid_message'>message</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>topic</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
744
|
+
<span class='kw'>else</span>
|
745
|
+
<span class='lbracket'>[</span><span class='id identifier rubyid_decoded'>decoded</span><span class='comma'>,</span> <span class='id identifier rubyid_message'>message</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>topic</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span><span class='rbracket'>]</span>
|
746
|
+
<span class='kw'>end</span>
|
747
|
+
<span class='kw'>end</span></pre>
|
748
|
+
</td>
|
749
|
+
</tr>
|
750
|
+
</table>
|
751
|
+
</div>
|
752
|
+
|
753
|
+
<div class="method_details ">
|
754
|
+
<h3 class="signature " id="subscribe-instance_method">
|
415
755
|
|
416
756
|
- (<tt>Boolean</tt>) <strong>subscribe</strong>(topic)
|
417
757
|
|
@@ -487,12 +827,12 @@ provided, #initialize calls #subscribe automatically.</p>
|
|
487
827
|
<pre class="lines">
|
488
828
|
|
489
829
|
|
490
|
-
|
491
|
-
|
492
|
-
|
830
|
+
81
|
831
|
+
82
|
832
|
+
83</pre>
|
493
833
|
</td>
|
494
834
|
<td>
|
495
|
-
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line
|
835
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq/subscribe.rb', line 81</span>
|
496
836
|
|
497
837
|
<span class='kw'>def</span> <span class='id identifier rubyid_subscribe'>subscribe</span><span class='lparen'>(</span><span class='id identifier rubyid_topic'>topic</span><span class='rparen'>)</span>
|
498
838
|
<span class='ivar'>@socket</span><span class='period'>.</span><span class='id identifier rubyid_setsockopt'>setsockopt</span><span class='lparen'>(</span><span class='const'>ZMQ</span><span class='op'>::</span><span class='const'>SUBSCRIBE</span><span class='comma'>,</span> <span class='id identifier rubyid_topic'>topic</span><span class='rparen'>)</span> <span class='op'>==</span> <span class='int'>0</span>
|
@@ -567,12 +907,12 @@ set, this will only remove one.</p>
|
|
567
907
|
<pre class="lines">
|
568
908
|
|
569
909
|
|
570
|
-
|
571
|
-
|
572
|
-
|
910
|
+
92
|
911
|
+
93
|
912
|
+
94</pre>
|
573
913
|
</td>
|
574
914
|
<td>
|
575
|
-
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line
|
915
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq/subscribe.rb', line 92</span>
|
576
916
|
|
577
917
|
<span class='kw'>def</span> <span class='id identifier rubyid_unsubscribe'>unsubscribe</span><span class='lparen'>(</span><span class='id identifier rubyid_topic'>topic</span><span class='rparen'>)</span>
|
578
918
|
<span class='ivar'>@socket</span><span class='period'>.</span><span class='id identifier rubyid_setsockopt'>setsockopt</span><span class='lparen'>(</span><span class='const'>ZMQ</span><span class='op'>::</span><span class='const'>UNSUBSCRIBE</span><span class='comma'>,</span> <span class='id identifier rubyid_topic'>topic</span><span class='rparen'>)</span> <span class='op'>==</span> <span class='int'>0</span>
|
@@ -587,7 +927,7 @@ set, this will only remove one.</p>
|
|
587
927
|
</div>
|
588
928
|
|
589
929
|
<div id="footer">
|
590
|
-
Generated on
|
930
|
+
Generated on Tue Jan 20 23:17:35 2015 by
|
591
931
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
592
932
|
0.8.7.6 (ruby-2.0.0).
|
593
933
|
</div>
|
data/doc/_index.html
CHANGED
@@ -174,7 +174,7 @@
|
|
174
174
|
</div>
|
175
175
|
|
176
176
|
<div id="footer">
|
177
|
-
Generated on
|
177
|
+
Generated on Tue Jan 20 23:17:34 2015 by
|
178
178
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
179
179
|
0.8.7.6 (ruby-2.0.0).
|
180
180
|
</div>
|
data/doc/file.README.html
CHANGED
@@ -63,6 +63,10 @@
|
|
63
63
|
|
64
64
|
<div id="content"><div id='filecontents'><h1><a href="https://colstrom.github.io/ezmq/">EZMQ (Effortless ZeroMQ)</a></h1>
|
65
65
|
|
66
|
+
<p><a href="http://badge.fury.io/rb/ezmq"><img src="https://badge.fury.io/rb/ezmq.svg" alt="Gem Version" /></a>
|
67
|
+
<a href="https://gemnasium.com/colstrom/ezmq"><img src="https://gemnasium.com/colstrom/ezmq.svg" alt="Dependency Status" /></a>
|
68
|
+
<a href="https://codeclimate.com/github/colstrom/ezmq"><img src="https://codeclimate.com/github/colstrom/ezmq/badges/gpa.svg" alt="Code Climate" /></a></p>
|
69
|
+
|
66
70
|
<h2>Overview</h2>
|
67
71
|
|
68
72
|
<p>EZMQ is a wrapper around the wonderful <code>ffi-rzmq</code> gem, which (as the name suggests) uses FFI, and exposes a fairly raw C-like interface. As elegant as 0MQ is, C doesn't feel like Ruby, and FFI bindings feel like C. EZMQ makes some reasonable assumptions to help you focus on what makes your code special, and not worry about setting up 0MQ.</p>
|
@@ -136,10 +140,10 @@
|
|
136
140
|
|
137
141
|
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>ezmq</span><span class='tstring_end'>'</span></span>
|
138
142
|
|
139
|
-
<span class='id identifier rubyid_publisher'>publisher</span> <span class='op'>=</span> <span class='const'>EZMQ</span><span class='period'>.</span><span class='const'>Publisher</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
143
|
+
<span class='id identifier rubyid_publisher'>publisher</span> <span class='op'>=</span> <span class='const'>EZMQ</span><span class='period'>.</span><span class='const'>Publisher</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
140
144
|
|
141
145
|
<span class='id identifier rubyid_loop'>loop</span> <span class='kw'>do</span>
|
142
|
-
<span class='id identifier rubyid_publisher'>publisher</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>foo</span><span class='tstring_end'>'</span></span>
|
146
|
+
<span class='id identifier rubyid_publisher'>publisher</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>foo</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_content'>foorever</span><span class='tstring_end'>'</span></span>
|
143
147
|
<span class='kw'>end</span>
|
144
148
|
</code></pre>
|
145
149
|
|
@@ -226,7 +230,7 @@ sudo aptitude install libzmq3-dev
|
|
226
230
|
</div></div>
|
227
231
|
|
228
232
|
<div id="footer">
|
229
|
-
Generated on
|
233
|
+
Generated on Tue Jan 20 23:17:34 2015 by
|
230
234
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
231
235
|
0.8.7.6 (ruby-2.0.0).
|
232
236
|
</div>
|
data/doc/index.html
CHANGED
@@ -63,6 +63,10 @@
|
|
63
63
|
|
64
64
|
<div id="content"><div id='filecontents'><h1><a href="https://colstrom.github.io/ezmq/">EZMQ (Effortless ZeroMQ)</a></h1>
|
65
65
|
|
66
|
+
<p><a href="http://badge.fury.io/rb/ezmq"><img src="https://badge.fury.io/rb/ezmq.svg" alt="Gem Version" /></a>
|
67
|
+
<a href="https://gemnasium.com/colstrom/ezmq"><img src="https://gemnasium.com/colstrom/ezmq.svg" alt="Dependency Status" /></a>
|
68
|
+
<a href="https://codeclimate.com/github/colstrom/ezmq"><img src="https://codeclimate.com/github/colstrom/ezmq/badges/gpa.svg" alt="Code Climate" /></a></p>
|
69
|
+
|
66
70
|
<h2>Overview</h2>
|
67
71
|
|
68
72
|
<p>EZMQ is a wrapper around the wonderful <code>ffi-rzmq</code> gem, which (as the name suggests) uses FFI, and exposes a fairly raw C-like interface. As elegant as 0MQ is, C doesn't feel like Ruby, and FFI bindings feel like C. EZMQ makes some reasonable assumptions to help you focus on what makes your code special, and not worry about setting up 0MQ.</p>
|
@@ -136,10 +140,10 @@
|
|
136
140
|
|
137
141
|
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>ezmq</span><span class='tstring_end'>'</span></span>
|
138
142
|
|
139
|
-
<span class='id identifier rubyid_publisher'>publisher</span> <span class='op'>=</span> <span class='const'>EZMQ</span><span class='period'>.</span><span class='const'>Publisher</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
143
|
+
<span class='id identifier rubyid_publisher'>publisher</span> <span class='op'>=</span> <span class='const'>EZMQ</span><span class='period'>.</span><span class='const'>Publisher</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
140
144
|
|
141
145
|
<span class='id identifier rubyid_loop'>loop</span> <span class='kw'>do</span>
|
142
|
-
<span class='id identifier rubyid_publisher'>publisher</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>foo</span><span class='tstring_end'>'</span></span>
|
146
|
+
<span class='id identifier rubyid_publisher'>publisher</span><span class='period'>.</span><span class='id identifier rubyid_send'>send</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>foo</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_content'>foorever</span><span class='tstring_end'>'</span></span>
|
143
147
|
<span class='kw'>end</span>
|
144
148
|
</code></pre>
|
145
149
|
|
@@ -226,7 +230,7 @@ sudo aptitude install libzmq3-dev
|
|
226
230
|
</div></div>
|
227
231
|
|
228
232
|
<div id="footer">
|
229
|
-
Generated on
|
233
|
+
Generated on Tue Jan 20 23:17:34 2015 by
|
230
234
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
231
235
|
0.8.7.6 (ruby-2.0.0).
|
232
236
|
</div>
|
data/doc/method_list.html
CHANGED
@@ -88,8 +88,8 @@
|
|
88
88
|
|
89
89
|
|
90
90
|
<li class="r1 ">
|
91
|
-
<span class='object_link'><a href="EZMQ/
|
92
|
-
<small>EZMQ::
|
91
|
+
<span class='object_link'><a href="EZMQ/Puller.html#initialize-instance_method" title="EZMQ::Puller#initialize (method)">#initialize</a></span>
|
92
|
+
<small>EZMQ::Puller</small>
|
93
93
|
</li>
|
94
94
|
|
95
95
|
|
@@ -106,26 +106,38 @@
|
|
106
106
|
|
107
107
|
|
108
108
|
<li class="r2 ">
|
109
|
-
<span class='object_link'><a href="EZMQ/
|
110
|
-
<small>EZMQ::
|
109
|
+
<span class='object_link'><a href="EZMQ/Client.html#initialize-instance_method" title="EZMQ::Client#initialize (method)">#initialize</a></span>
|
110
|
+
<small>EZMQ::Client</small>
|
111
111
|
</li>
|
112
112
|
|
113
113
|
|
114
114
|
<li class="r1 ">
|
115
|
-
<span class='object_link'><a href="EZMQ/
|
116
|
-
<small>EZMQ::
|
115
|
+
<span class='object_link'><a href="EZMQ/Publisher.html#initialize-instance_method" title="EZMQ::Publisher#initialize (method)">#initialize</a></span>
|
116
|
+
<small>EZMQ::Publisher</small>
|
117
117
|
</li>
|
118
118
|
|
119
119
|
|
120
120
|
<li class="r2 ">
|
121
|
+
<span class='object_link'><a href="EZMQ/Pusher.html#initialize-instance_method" title="EZMQ::Pusher#initialize (method)">#initialize</a></span>
|
122
|
+
<small>EZMQ::Pusher</small>
|
123
|
+
</li>
|
124
|
+
|
125
|
+
|
126
|
+
<li class="r1 ">
|
121
127
|
<span class='object_link'><a href="EZMQ/Server.html#initialize-instance_method" title="EZMQ::Server#initialize (method)">#initialize</a></span>
|
122
128
|
<small>EZMQ::Server</small>
|
123
129
|
</li>
|
124
130
|
|
125
131
|
|
132
|
+
<li class="r2 ">
|
133
|
+
<span class='object_link'><a href="EZMQ/Socket.html#listen-instance_method" title="EZMQ::Socket#listen (method)">#listen</a></span>
|
134
|
+
<small>EZMQ::Socket</small>
|
135
|
+
</li>
|
136
|
+
|
137
|
+
|
126
138
|
<li class="r1 ">
|
127
|
-
<span class='object_link'><a href="EZMQ/
|
128
|
-
<small>EZMQ::
|
139
|
+
<span class='object_link'><a href="EZMQ/Subscriber.html#listen-instance_method" title="EZMQ::Subscriber#listen (method)">#listen</a></span>
|
140
|
+
<small>EZMQ::Subscriber</small>
|
129
141
|
</li>
|
130
142
|
|
131
143
|
|
@@ -136,14 +148,14 @@
|
|
136
148
|
|
137
149
|
|
138
150
|
<li class="r1 ">
|
139
|
-
<span class='object_link'><a href="EZMQ/Socket.html#
|
151
|
+
<span class='object_link'><a href="EZMQ/Socket.html#receive-instance_method" title="EZMQ::Socket#receive (method)">#receive</a></span>
|
140
152
|
<small>EZMQ::Socket</small>
|
141
153
|
</li>
|
142
154
|
|
143
155
|
|
144
156
|
<li class="r2 ">
|
145
|
-
<span class='object_link'><a href="EZMQ/
|
146
|
-
<small>EZMQ::
|
157
|
+
<span class='object_link'><a href="EZMQ/Subscriber.html#receive-instance_method" title="EZMQ::Subscriber#receive (method)">#receive</a></span>
|
158
|
+
<small>EZMQ::Subscriber</small>
|
147
159
|
</li>
|
148
160
|
|
149
161
|
|
@@ -103,7 +103,7 @@
|
|
103
103
|
</div>
|
104
104
|
|
105
105
|
<div id="footer">
|
106
|
-
Generated on
|
106
|
+
Generated on Tue Jan 20 23:17:34 2015 by
|
107
107
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
108
108
|
0.8.7.6 (ruby-2.0.0).
|
109
109
|
</div>
|
data/ezmq.gemspec
CHANGED
data/lib/ezmq/subscribe.rb
CHANGED
@@ -38,7 +38,7 @@ module EZMQ
|
|
38
38
|
message = ''
|
39
39
|
@socket.recv_string message
|
40
40
|
|
41
|
-
message = message.match(/^(?<topic>[^\ ]*)\
|
41
|
+
message = message.match(/^(?<topic>[^\ ]*)\ (?<body>.*)/)
|
42
42
|
|
43
43
|
decoded = (options[:decode] || @decode).call message['body']
|
44
44
|
if block_given?
|