fluq 0.7.3 → 0.7.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +7 -7
- data/fluq.gemspec +1 -0
- data/lib/fluq/reactor.rb +14 -15
- data/lib/fluq/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dd0315737359aba13bf67dc4ac588f57a12fedb4
|
4
|
+
data.tar.gz: 0f5456c2087986cd3a80561c9d756cafe05b52ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 01a1b080eb885a520b7517cda04157d8374f02b232ed09175a0345cb5259320c91242f3d223d06731f73cb0d11b0fc62fc35aa9b8d4dca0b2c5ff649431892f4
|
7
|
+
data.tar.gz: d6eac4e626670db21f1b3b89949924b74ab0a2e2ab74571b8a388d37904e9eeb6887e71cc73e42bb8f90fbc8620c11304b50b49e31f9e0c2a6e9047835a8a69c
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fluq (0.7.
|
4
|
+
fluq (0.7.5)
|
5
5
|
eventmachine-le
|
6
6
|
msgpack (~> 0.5.0)
|
7
7
|
oj (>= 2.0.10)
|
@@ -10,21 +10,21 @@ PATH
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
diff-lcs (1.2.
|
13
|
+
diff-lcs (1.2.5)
|
14
14
|
eventmachine-le (1.1.6)
|
15
|
-
msgpack (0.5.
|
16
|
-
oj (2.
|
15
|
+
msgpack (0.5.7)
|
16
|
+
oj (2.2.2)
|
17
17
|
rake (10.1.0)
|
18
18
|
rspec (2.14.1)
|
19
19
|
rspec-core (~> 2.14.0)
|
20
20
|
rspec-expectations (~> 2.14.0)
|
21
21
|
rspec-mocks (~> 2.14.0)
|
22
|
-
rspec-core (2.14.
|
23
|
-
rspec-expectations (2.14.
|
22
|
+
rspec-core (2.14.7)
|
23
|
+
rspec-expectations (2.14.4)
|
24
24
|
diff-lcs (>= 1.1.3, < 2.0)
|
25
25
|
rspec-mocks (2.14.4)
|
26
26
|
timed_lru (0.3.1)
|
27
|
-
yard (0.8.7.
|
27
|
+
yard (0.8.7.3)
|
28
28
|
|
29
29
|
PLATFORMS
|
30
30
|
java
|
data/fluq.gemspec
CHANGED
@@ -15,6 +15,7 @@ Gem::Specification.new do |s|
|
|
15
15
|
s.authors = ["Black Square Media"]
|
16
16
|
s.email = "info@blacksquaremedia.com"
|
17
17
|
s.homepage = "https://github.com/bsm/fluq"
|
18
|
+
s.licenses = ["MIT"]
|
18
19
|
|
19
20
|
s.require_path = 'lib'
|
20
21
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
data/lib/fluq/reactor.rb
CHANGED
@@ -59,22 +59,21 @@ class FluQ::Reactor
|
|
59
59
|
protected
|
60
60
|
|
61
61
|
def on_events(events)
|
62
|
-
handlers.
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
next if matching.empty?
|
62
|
+
handlers.map do |handler|
|
63
|
+
Thread.new { handle(handler, Time.now, events) }
|
64
|
+
end.each(&:join)
|
65
|
+
end
|
67
66
|
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
67
|
+
def handle(handler, start, events)
|
68
|
+
matching = handler.select(events)
|
69
|
+
::Timeout.timeout handler.config[:timeout] do
|
70
|
+
handler.on_events(matching)
|
71
|
+
end unless matching.empty?
|
72
|
+
logger.info { "#{handler.name} processed #{matching.size}/#{events.size} events in #{((Time.now - start) * 1000).round}ms" }
|
73
|
+
rescue Timeout::Error => tx
|
74
|
+
logger.crash "#{handler.class.name} #{handler.name} timeout out after #{handler.config[:timeout]}s", tx
|
75
|
+
rescue => ex
|
76
|
+
logger.crash "#{handler.class.name} #{handler.name} failed: #{ex.class.name} #{ex.message}", ex
|
78
77
|
end
|
79
78
|
|
80
79
|
end
|
data/lib/fluq/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluq
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.5
|
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: 2013-
|
11
|
+
date: 2013-11-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: msgpack
|
@@ -197,7 +197,8 @@ files:
|
|
197
197
|
- spec/scenario/log/.gitkeep
|
198
198
|
- spec/spec_helper.rb
|
199
199
|
homepage: https://github.com/bsm/fluq
|
200
|
-
licenses:
|
200
|
+
licenses:
|
201
|
+
- MIT
|
201
202
|
metadata: {}
|
202
203
|
post_install_message:
|
203
204
|
rdoc_options: []
|