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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 240ecd9e84a3fea2591a68753d3d19ac51cd3d16
4
- data.tar.gz: e7bf2c74811db0f04aa038005bb20e740184c627
3
+ metadata.gz: dd0315737359aba13bf67dc4ac588f57a12fedb4
4
+ data.tar.gz: 0f5456c2087986cd3a80561c9d756cafe05b52ca
5
5
  SHA512:
6
- metadata.gz: 32e440e6093f7561aa8eb24934657fdaa3b7d20d63e9683e313af0e2b845f8e6eba3a26d980c9e8a34ca98f80fbedc56e17d899651db79376ca704dff54b8fa6
7
- data.tar.gz: f719ef726e7712087ee14316086e1bc1a350c6f2b9369548ae86e5f35c7c4f629cc03f249a2e48b716ad036fb3a7c4c6b405e2d61930ff106d9f60e967d2dd57
6
+ metadata.gz: 01a1b080eb885a520b7517cda04157d8374f02b232ed09175a0345cb5259320c91242f3d223d06731f73cb0d11b0fc62fc35aa9b8d4dca0b2c5ff649431892f4
7
+ data.tar.gz: d6eac4e626670db21f1b3b89949924b74ab0a2e2ab74571b8a388d37904e9eeb6887e71cc73e42bb8f90fbc8620c11304b50b49e31f9e0c2a6e9047835a8a69c
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fluq (0.7.3)
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.4)
13
+ diff-lcs (1.2.5)
14
14
  eventmachine-le (1.1.6)
15
- msgpack (0.5.6)
16
- oj (2.1.7)
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.6)
23
- rspec-expectations (2.14.3)
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.2)
27
+ yard (0.8.7.3)
28
28
 
29
29
  PLATFORMS
30
30
  java
@@ -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) }
@@ -59,22 +59,21 @@ class FluQ::Reactor
59
59
  protected
60
60
 
61
61
  def on_events(events)
62
- handlers.each do |handler|
63
- start = Time.now
64
- begin
65
- matching = handler.select(events)
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
- ::Timeout.timeout handler.config[:timeout] do
69
- handler.on_events(matching)
70
- end
71
- logger.info { "#{handler.name} processed #{matching.size}/#{events.size} events in #{((Time.now - start) * 1000).round}ms" }
72
- rescue Timeout::Error => tx
73
- logger.crash "#{handler.class.name} #{handler.name} timeout out after #{handler.config[:timeout]}s", tx
74
- rescue => ex
75
- logger.crash "#{handler.class.name} #{handler.name} failed: #{ex.class.name} #{ex.message}", ex
76
- end
77
- end
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
@@ -1,3 +1,3 @@
1
1
  module FluQ
2
- VERSION = "0.7.3"
2
+ VERSION = "0.7.5"
3
3
  end
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.3
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-10-23 00:00:00.000000000 Z
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: []