fanout 0.1.0 → 1.0.0

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fanout.rb +6 -5
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 80838b403995721eed658925a0fc346f15a0b2c7
4
- data.tar.gz: e70c54930949eb43c6126a6a9d993e45ace51109
3
+ metadata.gz: 91333845d99fc60cbc33d14326dabd2036c34732
4
+ data.tar.gz: 8b725d0ebaa0a41d451322ebe6c665eed656608a
5
5
  SHA512:
6
- metadata.gz: a4b45a95ae151aeb20c322789ff234d184e9e7df41adbe0a053ccfb79952f89c218cc1eb15b7817155f4d9e49cb4f8011c2fd94eb2c1bf33354f4b3667393b1a
7
- data.tar.gz: 4f330bf19c829d632203b8d632e5d6b8e36c378bdfaba992d387e973334d42f9ad911e3d717d1385b003e1e5cc5e3597dd2664269c1f8f1f3650636fdfdae3a5
6
+ metadata.gz: 6b8bdb8142de083e954654e44a31db552f94b13ef846793e305ea3ec448f97681623a8f8eb9dc664287b514bc081839d4ec986e9ff1660e779fa4805664a7cab
7
+ data.tar.gz: eea51a928a7d110b8d1f9e48c16c179b1528a3c76c095ce4d0c802509d677045cd7b6a60cf592295b099f69774165c38df555570c0bc54ab1f8777955c2b274c
data/lib/fanout.rb CHANGED
@@ -21,6 +21,7 @@ class Fanout
21
21
  @realm = realm
22
22
  @key = key
23
23
  @ssl = ssl
24
+ at_exit { finish }
24
25
  end
25
26
 
26
27
  def publish(channel, data, id=nil, prev_id=nil)
@@ -28,11 +29,6 @@ class Fanout
28
29
  pub.publish(channel, Item.new(FppFormat.new(data), id, prev_id))
29
30
  end
30
31
 
31
- def finish
32
- pub = get_pubcontrol
33
- pub.finish
34
- end
35
-
36
32
  def publish_async(channel, data, id=nil, prev_id=nil, callback=nil)
37
33
  pub = get_pubcontrol
38
34
  pub.publish_async(channel, Item.new(FppFormat.new(data), id, prev_id),
@@ -41,6 +37,11 @@ class Fanout
41
37
 
42
38
  private
43
39
 
40
+ def finish
41
+ pub = get_pubcontrol
42
+ pub.finish
43
+ end
44
+
44
45
  def get_pubcontrol
45
46
  if Thread.current['pubcontrol'].nil?
46
47
  if @ssl
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fanout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Bokarius