liquid-ext 3.3.10 → 3.4.0

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: 82683e832321797e925551d1f081800e946faa58
4
- data.tar.gz: 317a7df5e313e446574b729999fe625926f97bb1
3
+ metadata.gz: a4b048849eb561c44281ed24378e6bd7b44adce4
4
+ data.tar.gz: 8318a3d0bca98da80887a512af6c50ddfd80c1e9
5
5
  SHA512:
6
- metadata.gz: 766ba305e8574151e6b28d75f1d94cc9a8a4ac2205fc40819f2c3ddad7cd91f770b82ddeeeb08d75e490563f5c42f4626900e51113879a3c6666471288ec26f3
7
- data.tar.gz: 88ef9d4567fd9c5f56bf4dc1f98a982c1d50d0b7366fcef59ac672b3179fec1aca02cef8fa591c333feef7706fcd9149a5ce48bece9e09b94f4834ebc0e6e1d3
6
+ metadata.gz: 61ef72dd4e410c82277e7f2f10a5e69f27938a13474e6a7b7e9a3bb8601fb73ab9aee2b18c8907370c817faecf83e26630cbf44a2eb68606203902271c1d335a
7
+ data.tar.gz: fc4ba70a507d8cc52c6656e7ddd82609bea99077d13bc40747f537e21b6901c250c297d671e3d3c79a8e8420eabdc65be60f6caae7ec62b1f00c916289b48d32
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- liquid-ext (3.3.10)
4
+ liquid-ext (3.4.0)
5
5
  activesupport
6
6
  erubis
7
7
  jmx4r
@@ -57,7 +57,7 @@ GEM
57
57
  method_source (0.8.2)
58
58
  mini_portile (0.5.3)
59
59
  minitest (5.3.3)
60
- mixlib-cli (1.4.0)
60
+ mixlib-cli (1.5.0)
61
61
  multi_json (1.9.2)
62
62
  nokogiri (1.6.1-java)
63
63
  mini_portile (~> 0.5.0)
@@ -1,3 +1,5 @@
1
+ require 'ipaddr'
2
+
1
3
  class Socket
2
4
  def self.ipaddress
3
5
  hostname = %x(hostname).chomp
@@ -21,11 +21,16 @@ class HealthCheck
21
21
  end
22
22
 
23
23
  @@checks = {}
24
+ @@callbacks = []
24
25
 
25
26
  def self.inherited(child)
26
27
  @@checks[child.name.demodulize] = child
27
28
  end
28
29
 
30
+ def self.callback(cb = nil, &block)
31
+ @@callbacks << (cb || block)
32
+ end
33
+
29
34
  def self.run
30
35
  @@checks.inject({}) do |result, (name, handler)|
31
36
  result[name] = handler.new.execute
@@ -35,13 +40,20 @@ class HealthCheck
35
40
 
36
41
  def self.poll(interval = 5)
37
42
  loop do
38
- @healthy = run.values.all?(&:healthy?)
39
43
  sleep(interval)
44
+ trigger
45
+ end
46
+ end
47
+
48
+ def self.trigger
49
+ results = run
50
+ @@callbacks.each do |cb|
51
+ cb.call(results)
40
52
  end
41
53
  end
42
54
 
43
55
  def self.healthy?
44
- @healthy.nil? ? run.values.all?(&:healthy?) : @healthy
56
+ run.values.all?(&:healthy?)
45
57
  end
46
58
 
47
59
  def execute
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "liquid-ext"
5
- spec.version = "3.3.10"
5
+ spec.version = "3.4.0"
6
6
  spec.authors = ["LiquidM, Inc."]
7
7
  spec.email = ["opensource@liquidm.com"]
8
8
  spec.description = %q{Ruby core extensions and helper libraries}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: liquid-ext
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.10
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - LiquidM, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-04-25 00:00:00.000000000 Z
11
+ date: 2014-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -141,6 +141,7 @@ files:
141
141
  - lib/liquid/guava-16.0.1.jar
142
142
  - lib/liquid/hash_helper.rb
143
143
  - lib/liquid/health_checks.rb
144
+ - lib/liquid/javassist-3.15.0-GA.jar
144
145
  - lib/liquid/jeromq-0.3.3.jar
145
146
  - lib/liquid/kafka_2.10-0.8.0.jar
146
147
  - lib/liquid/log4j-1.2.17.jar