tiny_bus 3.8.0 → 3.8.1

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/tiny_bus.rb +6 -1
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 38ce7566363b86a218bb2860573779d5737e6051bc34b78051ca0f20d737ada1
4
- data.tar.gz: af3d2e8f729655b6907793580c20024ff94c3fb5bda862266623c78c94d35dbf
3
+ metadata.gz: 429d6ba2f802f4f2bc9ad911848ce80bc8c32cc88036917014314056d585b0d3
4
+ data.tar.gz: 574ef955a90a8c5dcb5be27b360b7d4252f205aaaaa726d6324dcc279746fd94
5
5
  SHA512:
6
- metadata.gz: a4e70298e41c92c63bdd3dc88ac487ab301823aba258198cae8ea10256170fec4c08ac9ba7bc2acfa722c1c57c933858d07302b8f2ef4fac2ba57c21ee5d4a77
7
- data.tar.gz: bc01af0b3a2a97770972103424f0220f20629eed25e0ae1613029b09a8b14083c39233d7ac52faf13576771b57358885cc325160f54fa95ad7518b7a745221d4
6
+ metadata.gz: 6222ee3a89fd3c310aea779231757ec0c6e32eda7b7ffa5a80a593ff0ae6259ebeab5db3aab063aa1c132643e3acb73014c4fc04116dedc837a4724ac610dce0
7
+ data.tar.gz: f08b289ca33b5ad679487c1cdad4e04413b4ea6cbe6442ec966e5b859c15a2e689ea3d7fc425a5c6ed132851a87d45540ca797c0f221a646978495f24ecf3116
data/lib/tiny_bus.rb CHANGED
@@ -127,7 +127,12 @@ class TinyBus
127
127
  @stats[@total_key] += 1
128
128
  @stats[topic] += 1
129
129
  if (subbers&.length || 0) > 0
130
- subbers.each{|s| s.msg(msg) }
130
+ # cloning is necessary, because sending messanges may result in new
131
+ # subscribers to the same topic we're iterating over right now. in that
132
+ # situation we would run into a RuntimeError that prevented the
133
+ # modification of the Set we're iterating over to send messages.
134
+ subbers.clone.each{|s| s.msg(msg) }
135
+
131
136
  @log.send(lvl, "S #{msg}")
132
137
  else
133
138
  if @raise_on_dead
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tiny_bus
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.8.0
4
+ version: 3.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Lunt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-19 00:00:00.000000000 Z
11
+ date: 2023-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tiny_log