refinery 0.9.6 → 0.9.7
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/refinery/event_publisher.rb +26 -18
- data/refinery.gemspec +2 -2
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.9.
|
1
|
+
0.9.7
|
@@ -80,32 +80,40 @@ module Refinery #:nodoc:
|
|
80
80
|
|
81
81
|
# Run the publisher for the given key
|
82
82
|
def run_publisher(key, settings)
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
83
|
+
if File.exists?(source_file(key))
|
84
|
+
prefix = config['prefix'] || ''
|
85
|
+
logger.info "Creating publisher for #{key}"
|
86
|
+
queue_name = settings['queue'] || key
|
87
|
+
queue_name = "#{prefix}#{queue_name}"
|
88
|
+
logger.debug "Using queue #{queue_name}_waiting"
|
89
|
+
waiting_queue = queue("#{queue_name}_waiting")
|
89
90
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
91
|
+
threads << Thread.new(waiting_queue, settings) do |waiting_queue, settings|
|
92
|
+
while(running?)
|
93
|
+
begin
|
94
|
+
load_publisher_class(key).new(waiting_queue).execute
|
95
|
+
rescue Exception => e
|
96
|
+
logger.error e
|
97
|
+
raise e
|
98
|
+
end
|
98
99
|
|
99
|
-
|
100
|
-
|
101
|
-
|
100
|
+
delay = settings['publishers']['delay'] || 60
|
101
|
+
logger.debug "Sleeping #{delay} seconds"
|
102
|
+
sleep delay
|
102
103
|
|
104
|
+
end
|
103
105
|
end
|
106
|
+
else
|
107
|
+
logger.warn "No publisher found for #{key}"
|
104
108
|
end
|
105
109
|
end
|
106
110
|
|
107
|
-
def
|
111
|
+
def source_file(key)
|
108
112
|
source_file = "#{publishers_directory}/#{key}.rb"
|
113
|
+
end
|
114
|
+
|
115
|
+
def load_publisher_class(key)
|
116
|
+
source_file = source_file(key)
|
109
117
|
if File.exist?(source_file)
|
110
118
|
modified_at = File.mtime(source_file)
|
111
119
|
if publishers[key] != modified_at
|
data/refinery.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{refinery}
|
5
|
-
s.version = "0.9.
|
5
|
+
s.version = "0.9.7"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Anthony Eden"]
|
9
|
-
s.date = %q{2009-07-
|
9
|
+
s.date = %q{2009-07-06}
|
10
10
|
s.description = %q{Process data in a distributed fashion.}
|
11
11
|
s.email = %q{anthonyeden@gmail.com}
|
12
12
|
s.executables = ["epub", "monitor", "pubnow", "refinery"]
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: refinery
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anthony Eden
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-07-
|
12
|
+
date: 2009-07-06 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|