bps 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7dcfafba4e1ba7aec2d812ed9a900d8c456b3805aaa7fc06b3aaa09a25a82fe7
4
- data.tar.gz: a26e3d94327c39234daad0381504dda9024a26ff61640935d5e911746601fb46
3
+ metadata.gz: a7ea055a7a6f92d9464ec2a7142a94c414cea104ab54684b561c6dfebf5107f9
4
+ data.tar.gz: 97c3f004f66bdeca362e188511ff44bbc118ac852b65f362510cf87e9410f93e
5
5
  SHA512:
6
- metadata.gz: 593c087d4fd8dc66cb737c8da308269cbf2d0aa1cff40a7eb88dc29532405eceb075b92ba11f90e06c527eb20b83a7a4c923a3e0b8db73289ea55a23bf5e0ed7
7
- data.tar.gz: fabb9c003aff6112f935fcf4e41e5c1f21a5ed29d731bde44e8efef332e45b6a8dab708977ce8e8789fa24775c3b9628a65876114f103d07df9c9c168b2ce710
6
+ metadata.gz: 28a8bf949c811ca202265494dc7ae1c2277b53b953f6786d74b425b252ce59a98c6f6ff1cf0fff8c8cc7e711710b075b0f9807332c1b89eb42eb1ab5a166d0e9
7
+ data.tar.gz: 64d9f267c210fc2be7901563050d7f30901f8473a8c3c616b88620edf9aac8e41c13a6295d861b5547fd087a9a24f905805662a7ae4135ecc3a4d9a5d1ccd06f
@@ -1,3 +1,5 @@
1
+ require 'securerandom'
2
+
1
3
  module BPS
2
4
  module Publisher
3
5
  class Abstract
@@ -12,7 +14,8 @@ module BPS
12
14
  end
13
15
 
14
16
  def initialize
15
- ObjectSpace.define_finalizer(self, proc { close })
17
+ @uuid = SecureRandom.uuid
18
+ ObjectSpace.define_finalizer(@uuid, proc { close })
16
19
  end
17
20
 
18
21
  # Retrieve a topic handle.
@@ -22,7 +25,9 @@ module BPS
22
25
  end
23
26
 
24
27
  # Close the publisher.
25
- def close; end
28
+ def close
29
+ ObjectSpace.undefine_finalizer(@uuid)
30
+ end
26
31
  end
27
32
  end
28
33
  end
@@ -2,7 +2,8 @@ module BPS
2
2
  module Subscriber
3
3
  class Abstract
4
4
  def initialize
5
- ObjectSpace.define_finalizer(self, proc { close })
5
+ @uuid = SecureRandom.uuid
6
+ ObjectSpace.define_finalizer(@uuid, proc { close })
6
7
  end
7
8
 
8
9
  # Subscribe to a topic
@@ -12,7 +13,9 @@ module BPS
12
13
  end
13
14
 
14
15
  # Close the subscriber.
15
- def close; end
16
+ def close
17
+ ObjectSpace.undefine_finalizer(@uuid)
18
+ end
16
19
  end
17
20
  end
18
21
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bps
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Black Square Media
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-05 00:00:00.000000000 Z
11
+ date: 2021-09-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Minimalist abstraction for publish-subscribe
14
14
  email: info@blacksquaremedia.com
@@ -43,7 +43,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
43
43
  - !ruby/object:Gem::Version
44
44
  version: '0'
45
45
  requirements: []
46
- rubygems_version: 3.1.4
46
+ rubygems_version: 3.2.15
47
47
  signing_key:
48
48
  specification_version: 4
49
49
  summary: Multi-platform pubsub adapter