wires 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/wires/hub.rb +15 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d72f9190bfd10374aa6b7a6dd5b6514cda1cd439
4
- data.tar.gz: 09da831c965785c1fa55faaf48f1276ecec12d2c
3
+ metadata.gz: cb97d55c948913573e2401e46550542dae250305
4
+ data.tar.gz: d98c4ada2a9c71859afb47be0ede706b37beafc1
5
5
  SHA512:
6
- metadata.gz: 0187c7ade4378ebaa10f861e3e0f9c20a60b84ce319c914644b0a598c7274a8ee054c12708aab0843557152e66ae2adbbc13cf05fbbf7037d0072caa0e3ca023
7
- data.tar.gz: c00baf917ecbfca83f43cbefac1877c1eecfb14043f4834863288cbf777ecb66c0c328d4dfd1a6701a74de2ab593d8d60ee1404fd92417bb3fad9635d4999fa1
6
+ metadata.gz: ece77fc145f4c03da156da35159b53f512690879074f4a291e43739d846933ad65511d2b56b89687462bafd9d7c4292ba34b33cc21acdd12d9081839a7e2bc4d
7
+ data.tar.gz: 57a1a47f9907b9e6d7ce4688ea15f2f9a863333baed10b9d686cc17bd143673a875fd3efcaf19e1e7e95a23f4919fa9df511243a9ec8b13e7c30fcc9563bf8f2
data/lib/wires/hub.rb CHANGED
@@ -15,9 +15,23 @@ module Wires
15
15
  @before_kills = Queue.new
16
16
  @after_kills = Queue.new
17
17
 
18
+ @please_finish_all = false
19
+ @please_kill = false
20
+
18
21
  # Operate on the metaclass as a type of singleton pattern
19
22
  class << self
20
23
 
24
+ # Clone all clonable instance variables as well
25
+ def clone_deeper
26
+ result = clone
27
+ self.instance_variables.each do |sym|
28
+ begin varcopy = instance_variable_get(sym).clone
29
+ rescue TypeError; end
30
+ result.instance_variable_set(sym, varcopy)
31
+ end
32
+ result
33
+ end
34
+
21
35
  def dead?; state==:dead end
22
36
  def alive?; state==:alive end
23
37
 
@@ -165,7 +179,6 @@ module Wires
165
179
  impose_state :dead
166
180
 
167
181
  declare_state :dead do
168
- # task { puts "I'm dead!" }
169
182
 
170
183
  transition_to :alive do
171
184
  after { start_hegemon_auto_thread }
@@ -173,8 +186,7 @@ module Wires
173
186
  end
174
187
 
175
188
  declare_state :alive do
176
- # task { puts "I'm alive!" }
177
- # task { sleep 0.05 }
189
+
178
190
  task do
179
191
  # puts "task #{Thread.current.inspect}";
180
192
  if @queue.empty? then sleep(0)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wires
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe McIlvain