ezmq 0.1.1 → 0.1.2
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 +4 -4
- data/doc/EZMQ/Client.html +1 -1
- data/doc/EZMQ/Publisher.html +1 -1
- data/doc/EZMQ/Server.html +1 -1
- data/doc/EZMQ/Socket.html +1 -1
- data/doc/EZMQ/Subscriber.html +28 -20
- data/doc/EZMQ.html +1 -1
- data/doc/_index.html +1 -1
- data/doc/file.README.html +1 -1
- data/doc/index.html +1 -1
- data/doc/top-level-namespace.html +1 -1
- data/ezmq.gemspec +2 -2
- data/lib/ezmq.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 53f27cf838fcd7f6dfe55aa2876eca322e4d1771
|
|
4
|
+
data.tar.gz: 29a2a8f41c6de6f0302ef8492ddda546a6b6702b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 67e6d18714294b269610295c0f279175e848678ac8521f86d745e9105490b057ba2f491172ac7eaf611894c66b566279a7b7bd67547e8b2241934a3e86e887d9
|
|
7
|
+
data.tar.gz: 9d4abe01a0061edd3b441749759ced76f3f558b351c65e49c377225e671d71089408c014a1c98e95c293fb0a8da3f591df27d2dc25ff5227de4cd397d540a405
|
data/doc/EZMQ/Client.html
CHANGED
|
@@ -376,7 +376,7 @@
|
|
|
376
376
|
</div>
|
|
377
377
|
|
|
378
378
|
<div id="footer">
|
|
379
|
-
Generated on Tue Jan 6
|
|
379
|
+
Generated on Tue Jan 6 12:58:18 2015 by
|
|
380
380
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
381
381
|
0.8.7.6 (ruby-2.0.0).
|
|
382
382
|
</div>
|
data/doc/EZMQ/Publisher.html
CHANGED
|
@@ -392,7 +392,7 @@
|
|
|
392
392
|
</div>
|
|
393
393
|
|
|
394
394
|
<div id="footer">
|
|
395
|
-
Generated on Tue Jan 6
|
|
395
|
+
Generated on Tue Jan 6 12:58:18 2015 by
|
|
396
396
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
397
397
|
0.8.7.6 (ruby-2.0.0).
|
|
398
398
|
</div>
|
data/doc/EZMQ/Server.html
CHANGED
|
@@ -440,7 +440,7 @@ the result, then loops.</p>
|
|
|
440
440
|
</div>
|
|
441
441
|
|
|
442
442
|
<div id="footer">
|
|
443
|
-
Generated on Tue Jan 6
|
|
443
|
+
Generated on Tue Jan 6 12:58:18 2015 by
|
|
444
444
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
445
445
|
0.8.7.6 (ruby-2.0.0).
|
|
446
446
|
</div>
|
data/doc/EZMQ/Socket.html
CHANGED
|
@@ -1075,7 +1075,7 @@
|
|
|
1075
1075
|
</div>
|
|
1076
1076
|
|
|
1077
1077
|
<div id="footer">
|
|
1078
|
-
Generated on Tue Jan 6
|
|
1078
|
+
Generated on Tue Jan 6 12:58:18 2015 by
|
|
1079
1079
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
1080
1080
|
0.8.7.6 (ruby-2.0.0).
|
|
1081
1081
|
</div>
|
data/doc/EZMQ/Subscriber.html
CHANGED
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
<li class="public ">
|
|
168
168
|
<span class="summary_signature">
|
|
169
169
|
|
|
170
|
-
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Publisher) <strong>initialize</strong>(action: -> m { m }, **options) </a>
|
|
170
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">- (Publisher) <strong>initialize</strong>(action: -> m { puts m }, **options) </a>
|
|
171
171
|
|
|
172
172
|
|
|
173
173
|
|
|
@@ -282,7 +282,7 @@
|
|
|
282
282
|
<div class="method_details first">
|
|
283
283
|
<h3 class="signature first" id="initialize-instance_method">
|
|
284
284
|
|
|
285
|
-
- (<tt><span class='object_link'><a href="Publisher.html" title="EZMQ::Publisher (class)">Publisher</a></span></tt>) <strong>initialize</strong>(action: -> m { m }, **options)
|
|
285
|
+
- (<tt><span class='object_link'><a href="Publisher.html" title="EZMQ::Publisher (class)">Publisher</a></span></tt>) <strong>initialize</strong>(action: -> m { puts m }, **options)
|
|
286
286
|
|
|
287
287
|
|
|
288
288
|
|
|
@@ -291,6 +291,14 @@
|
|
|
291
291
|
</h3><div class="docstring">
|
|
292
292
|
<div class="discussion">
|
|
293
293
|
|
|
294
|
+
<div class="note notetag">
|
|
295
|
+
<strong>Note:</strong>
|
|
296
|
+
<div class='inline'>
|
|
297
|
+
<p>The default behaviour is to output and messages received to STDOUT.</p>
|
|
298
|
+
</div>
|
|
299
|
+
</div>
|
|
300
|
+
|
|
301
|
+
|
|
294
302
|
<p>Creates a new Subscriber socket.</p>
|
|
295
303
|
|
|
296
304
|
|
|
@@ -372,16 +380,16 @@
|
|
|
372
380
|
<pre class="lines">
|
|
373
381
|
|
|
374
382
|
|
|
375
|
-
185
|
|
376
|
-
186
|
|
377
383
|
187
|
|
378
384
|
188
|
|
379
|
-
189
|
|
385
|
+
189
|
|
386
|
+
190
|
|
387
|
+
191</pre>
|
|
380
388
|
</td>
|
|
381
389
|
<td>
|
|
382
|
-
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line
|
|
390
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line 187</span>
|
|
383
391
|
|
|
384
|
-
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>action:</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>
|
|
392
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>action:</span> <span class='tlambda'>-></span> <span class='id identifier rubyid_m'>m</span> <span class='tlambeg'>{</span> <span class='id identifier rubyid_puts'>puts</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>
|
|
385
393
|
<span class='ivar'>@action</span> <span class='op'>=</span> <span class='id identifier rubyid_action'>action</span>
|
|
386
394
|
<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>
|
|
387
395
|
<span class='id identifier rubyid_subscribe'>subscribe</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:topic</span><span class='rbracket'>]</span> <span class='kw'>if</span> <span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:topic</span><span class='rbracket'>]</span>
|
|
@@ -492,12 +500,12 @@
|
|
|
492
500
|
<pre class="lines">
|
|
493
501
|
|
|
494
502
|
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
503
|
+
225
|
|
504
|
+
226
|
|
505
|
+
227</pre>
|
|
498
506
|
</td>
|
|
499
507
|
<td>
|
|
500
|
-
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line
|
|
508
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line 225</span>
|
|
501
509
|
|
|
502
510
|
<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='ivar'>@action</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>
|
|
503
511
|
<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>
|
|
@@ -584,12 +592,12 @@ provided, #initialize calls #subscribe automatically.</p>
|
|
|
584
592
|
<pre class="lines">
|
|
585
593
|
|
|
586
594
|
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
595
|
+
204
|
|
596
|
+
205
|
|
597
|
+
206</pre>
|
|
590
598
|
</td>
|
|
591
599
|
<td>
|
|
592
|
-
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line
|
|
600
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line 204</span>
|
|
593
601
|
|
|
594
602
|
<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>
|
|
595
603
|
<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> <span class='op'>?</span> <span class='kw'>true</span> <span class='op'>:</span> <span class='kw'>false</span>
|
|
@@ -664,12 +672,12 @@ set, this will only remove one.</p>
|
|
|
664
672
|
<pre class="lines">
|
|
665
673
|
|
|
666
674
|
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
675
|
+
215
|
|
676
|
+
216
|
|
677
|
+
217</pre>
|
|
670
678
|
</td>
|
|
671
679
|
<td>
|
|
672
|
-
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line
|
|
680
|
+
<pre class="code"><span class="info file"># File 'lib/ezmq.rb', line 215</span>
|
|
673
681
|
|
|
674
682
|
<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>
|
|
675
683
|
<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> <span class='op'>?</span> <span class='kw'>true</span> <span class='op'>:</span> <span class='kw'>false</span>
|
|
@@ -684,7 +692,7 @@ set, this will only remove one.</p>
|
|
|
684
692
|
</div>
|
|
685
693
|
|
|
686
694
|
<div id="footer">
|
|
687
|
-
Generated on Tue Jan 6
|
|
695
|
+
Generated on Tue Jan 6 12:58:18 2015 by
|
|
688
696
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
689
697
|
0.8.7.6 (ruby-2.0.0).
|
|
690
698
|
</div>
|
data/doc/EZMQ.html
CHANGED
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
</div>
|
|
118
118
|
|
|
119
119
|
<div id="footer">
|
|
120
|
-
Generated on Tue Jan 6
|
|
120
|
+
Generated on Tue Jan 6 12:58:18 2015 by
|
|
121
121
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
122
122
|
0.8.7.6 (ruby-2.0.0).
|
|
123
123
|
</div>
|
data/doc/_index.html
CHANGED
|
@@ -160,7 +160,7 @@
|
|
|
160
160
|
</div>
|
|
161
161
|
|
|
162
162
|
<div id="footer">
|
|
163
|
-
Generated on Tue Jan 6
|
|
163
|
+
Generated on Tue Jan 6 12:58:18 2015 by
|
|
164
164
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
165
165
|
0.8.7.6 (ruby-2.0.0).
|
|
166
166
|
</div>
|
data/doc/file.README.html
CHANGED
|
@@ -86,7 +86,7 @@ sudo aptitude install libzmq3-dev
|
|
|
86
86
|
</div></div>
|
|
87
87
|
|
|
88
88
|
<div id="footer">
|
|
89
|
-
Generated on Tue Jan 6
|
|
89
|
+
Generated on Tue Jan 6 12:58:18 2015 by
|
|
90
90
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
91
91
|
0.8.7.6 (ruby-2.0.0).
|
|
92
92
|
</div>
|
data/doc/index.html
CHANGED
|
@@ -86,7 +86,7 @@ sudo aptitude install libzmq3-dev
|
|
|
86
86
|
</div></div>
|
|
87
87
|
|
|
88
88
|
<div id="footer">
|
|
89
|
-
Generated on Tue Jan 6
|
|
89
|
+
Generated on Tue Jan 6 12:58:18 2015 by
|
|
90
90
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
91
91
|
0.8.7.6 (ruby-2.0.0).
|
|
92
92
|
</div>
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
</div>
|
|
104
104
|
|
|
105
105
|
<div id="footer">
|
|
106
|
-
Generated on Tue Jan 6
|
|
106
|
+
Generated on Tue Jan 6 12:58:18 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
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Gem::Specification.new do |gem|
|
|
2
2
|
gem.name = 'ezmq'
|
|
3
|
-
gem.version = '0.1.
|
|
3
|
+
gem.version = '0.1.2'
|
|
4
4
|
gem.licenses = 'MIT'
|
|
5
5
|
gem.authors = ['Chris Olstrom']
|
|
6
6
|
gem.email = 'chris@olstrom.com'
|
|
7
|
-
gem.homepage = '
|
|
7
|
+
gem.homepage = 'http://colstrom.github.io/ezmq/'
|
|
8
8
|
gem.summary = 'Effortless ZMQ'
|
|
9
9
|
gem.description = 'Syntactic sugar around FFI bindings for ZMQ, to stop C from seeping into your Ruby.'
|
|
10
10
|
|
data/lib/ezmq.rb
CHANGED
|
@@ -172,6 +172,8 @@ module EZMQ
|
|
|
172
172
|
attr_accessor :action
|
|
173
173
|
|
|
174
174
|
# Creates a new Subscriber socket.
|
|
175
|
+
#
|
|
176
|
+
# @note The default behaviour is to output and messages received to STDOUT.
|
|
175
177
|
#
|
|
176
178
|
# @param [lambda] action the action to perform when a message is received.
|
|
177
179
|
# @param [Hash] options optional parameters
|
|
@@ -182,7 +184,7 @@ module EZMQ
|
|
|
182
184
|
#
|
|
183
185
|
# @return [Publisher] a new instance of Publisher.
|
|
184
186
|
#
|
|
185
|
-
def initialize(action: -> m { m }, **options)
|
|
187
|
+
def initialize(action: -> m { puts m }, **options)
|
|
186
188
|
@action = action
|
|
187
189
|
super :connect, ZMQ::SUB, options
|
|
188
190
|
subscribe options[:topic] if options[:topic]
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ezmq
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chris Olstrom
|
|
@@ -184,7 +184,7 @@ files:
|
|
|
184
184
|
- doc/top-level-namespace.html
|
|
185
185
|
- ezmq.gemspec
|
|
186
186
|
- lib/ezmq.rb
|
|
187
|
-
homepage:
|
|
187
|
+
homepage: http://colstrom.github.io/ezmq/
|
|
188
188
|
licenses:
|
|
189
189
|
- MIT
|
|
190
190
|
metadata: {}
|