noah 0.2 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/noah-watcher.rb +2 -1
- data/config.ru +1 -1
- data/lib/noah/agent.rb +0 -3
- data/lib/noah/agents/base_agent.rb +17 -0
- data/lib/noah/agents/dummy_agent.rb +3 -5
- data/lib/noah/agents/http_agent.rb +3 -7
- data/lib/noah/models.rb +2 -1
- data/lib/noah/version.rb +1 -1
- metadata +4 -3
data/bin/noah-watcher.rb
CHANGED
data/config.ru
CHANGED
data/lib/noah/agent.rb
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'logger'
|
2
|
+
require 'logger'
|
3
|
+
|
4
|
+
module Noah::Agents
|
5
|
+
module Base
|
6
|
+
class << self
|
7
|
+
include EM::Deferrable
|
8
|
+
|
9
|
+
PREFIX = "base"
|
10
|
+
NAME = "base-agent"
|
11
|
+
end
|
12
|
+
|
13
|
+
def self.included(base)
|
14
|
+
Noah::Watchers.register_agent(base)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -1,14 +1,12 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'base_agent')
|
2
|
+
|
1
3
|
module Noah::Agents
|
2
4
|
class DummyAgent
|
3
|
-
include
|
5
|
+
include Noah::Agents::Base
|
4
6
|
|
5
7
|
PREFIX = "dummy"
|
6
8
|
NAME = "dummy"
|
7
9
|
|
8
|
-
def self.register
|
9
|
-
Noah::Watchers.register_agent(self)
|
10
|
-
end
|
11
|
-
|
12
10
|
def self.notify(event, message, watch_list)
|
13
11
|
logger = LOGGER
|
14
12
|
logger.info("#{NAME}: Worker initiated")
|
@@ -1,16 +1,12 @@
|
|
1
|
-
require '
|
1
|
+
require File.join(File.dirname(__FILE__), 'base_agent')
|
2
2
|
|
3
3
|
module Noah::Agents
|
4
4
|
class HttpAgent
|
5
|
-
include
|
5
|
+
include Noah::Agents::Base
|
6
6
|
|
7
7
|
PREFIX = "http"
|
8
8
|
NAME = "http"
|
9
9
|
|
10
|
-
def self.register
|
11
|
-
Noah::Watchers.register_agent(self)
|
12
|
-
end
|
13
|
-
|
14
10
|
def self.notify(event, message, watch_list)
|
15
11
|
logger = LOGGER
|
16
12
|
logger.info("#{NAME}: Worker initiated")
|
@@ -28,8 +24,8 @@ module Noah::Agents
|
|
28
24
|
http.errback {
|
29
25
|
logger.error("#{NAME}: Something went wrong with #{ep}")
|
30
26
|
}
|
31
|
-
iter.next
|
32
27
|
end
|
28
|
+
iter.next
|
33
29
|
end
|
34
30
|
end
|
35
31
|
|
data/lib/noah/models.rb
CHANGED
data/lib/noah/version.rb
CHANGED
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: noah
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version:
|
5
|
+
version: 0.2.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- John E. Vincent
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-03-
|
13
|
+
date: 2011-03-16 00:00:00 -04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
@@ -264,6 +264,7 @@ files:
|
|
264
264
|
- examples/websocket.rb
|
265
265
|
- lib/noah.rb
|
266
266
|
- lib/noah/agent.rb
|
267
|
+
- lib/noah/agents/base_agent.rb
|
267
268
|
- lib/noah/agents/dummy_agent.rb
|
268
269
|
- lib/noah/agents/http_agent.rb
|
269
270
|
- lib/noah/app.rb
|
@@ -332,7 +333,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
332
333
|
requirements: []
|
333
334
|
|
334
335
|
rubyforge_project: noah
|
335
|
-
rubygems_version: 1.
|
336
|
+
rubygems_version: 1.6.2
|
336
337
|
signing_key:
|
337
338
|
specification_version: 3
|
338
339
|
summary: Application registry based on Apache Zookeeper
|