wires 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wires/hub.rb +11 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eac9a387ed62e4acf7fc95260c323ace017c0f01
|
4
|
+
data.tar.gz: 97b7e1f9b746f68cd801d293bc126427df8e819f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
15
|
-
|
16
|
-
|
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()
|
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.
|
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-
|
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.
|