wires 0.1.5 → 0.1.6

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 +11 -4
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ffc466f024c5e1a6e59c435d1849af75dd19bf0c
4
- data.tar.gz: 34336c47982369319a614836b310442e5774e22f
3
+ metadata.gz: eac9a387ed62e4acf7fc95260c323ace017c0f01
4
+ data.tar.gz: 97b7e1f9b746f68cd801d293bc126427df8e819f
5
5
  SHA512:
6
- metadata.gz: 38e0d5dc15c590d25639f311e9a1029f358975343e174b342365ee1cbb8f6069a6bbf2a31acff62a83d2867a4f34292f82cf4d1eabc91709e204fca1adfc318f
7
- data.tar.gz: 68a7b2f5dcde44efb7c8553de8748acfb65ee949b3fb0a471035a13e1826d4bad88a4b4dbe1f60a65a356fedf16359e62af3d6e402b18d73d12210fafcf7f35c
6
+ metadata.gz: d423c7af695a85c07f48e6b0e5d1ba5be178205f09bb5588ea550fd40409ec775708959f64a1335a3ab72a6dff42f6a67d70834d5cb023bd04669ea1d2267594
7
+ data.tar.gz: f98fa6910fc0bd8418f8c8421bc25a48fb183e93689aa9dcd5134d03c5cfccb9a97f6128758bfa32d459e0a4e466f1f17c6c96d91a8f1497e1d0f68593e5201e
data/lib/wires/hub.rb CHANGED
@@ -9,14 +9,21 @@ class Hub
9
9
  @@queue = Queue.new
10
10
  @@running = false
11
11
 
12
+ def self.running?; @@running; end
13
+
12
14
  # Start the Hub event loop in a new thread
13
15
  def self.run
14
- @@thread = Thread.new() {Hub.run_loop}
15
- at_exit { @@thread.join if not $! }
16
- end
16
+ if not @@running
17
+ @@running = true
18
+ @@thread = Thread.new() {Hub.run_loop}
19
+ at_exit { @@thread.join if not $! }
20
+ end
21
+ nil end
17
22
 
18
23
  # Start the Hub event loop in the current thread
19
- def self.run_in_place() self.run_loop() end
24
+ def self.run_in_place()
25
+ self.run_loop() unless @@running
26
+ nil end
20
27
 
21
28
  # Kill the Hub event loop (softly)
22
29
  def self.kill() @@running=false end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wires
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe McIlvain
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-06-25 00:00:00.000000000 Z
11
+ date: 2013-06-26 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: An asynchronous (threaded) event routing framework in Ruby. Patch your
14
14
  objects together with wires. Inspired by the python 'circuits' framework.