isono 0.2.8 → 0.2.9
Sign up to get free protection for your applications and to get access to all the features.
- data/isono.gemspec +8 -9
- data/lib/isono/node_modules/rpc_channel.rb +9 -0
- data/lib/isono/rack/job.rb +10 -0
- data/lib/isono/version.rb +1 -1
- metadata +5 -7
data/isono.gemspec
CHANGED
@@ -2,20 +2,19 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{isono}
|
5
|
-
s.version = "0.2.
|
5
|
+
s.version = "0.2.9"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
|
-
s.authors = [
|
9
|
-
s.date = %q{2011-
|
10
|
-
s.
|
11
|
-
s.
|
12
|
-
s.
|
13
|
-
s.files = [".gitignore", "LICENSE", "NOTICE", "Rakefile", "bin/cli", "isono.gemspec", "lib/ext/shellwords.rb", "lib/isono.rb", "lib/isono/amqp_client.rb", "lib/isono/daemonize.rb", "lib/isono/event_delegate_context.rb", "lib/isono/event_observable.rb", "lib/isono/logger.rb", "lib/isono/manifest.rb", "lib/isono/messaging_client.rb", "lib/isono/models/event_log.rb", "lib/isono/models/job_state.rb", "lib/isono/models/node_state.rb", "lib/isono/models/resource_instance.rb", "lib/isono/node.rb", "lib/isono/node_modules/base.rb", "lib/isono/node_modules/data_store.rb", "lib/isono/node_modules/event_channel.rb", "lib/isono/node_modules/event_logger.rb", "lib/isono/node_modules/job_channel.rb", "lib/isono/node_modules/job_collector.rb", "lib/isono/node_modules/job_worker.rb", "lib/isono/node_modules/node_collector.rb", "lib/isono/node_modules/node_heartbeat.rb", "lib/isono/node_modules/rpc_channel.rb", "lib/isono/rack.rb", "lib/isono/rack/builder.rb", "lib/isono/rack/data_store.rb", "lib/isono/rack/job.rb", "lib/isono/rack/map.rb", "lib/isono/rack/object_method.rb", "lib/isono/rack/proc.rb", "lib/isono/rack/thread_pass.rb", "lib/isono/resource_manifest.rb", "lib/isono/runner/base.rb", "lib/isono/runner/cli.rb", "lib/isono/runner/rpc_server.rb", "lib/isono/serializer.rb", "lib/isono/thread_pool.rb", "lib/isono/util.rb", "lib/isono/version.rb", "spec/amqp_client_spec.rb", "spec/event_observable_spec.rb", "spec/file_channel_spec.rb", "spec/job_channel_spec.rb", "spec/logger_spec.rb", "spec/manifest_spec.rb", "spec/node_spec.rb", "spec/resource_loader_spec.rb", "spec/rpc_channel_spec.rb", "spec/spec_helper.rb", "spec/thread_pool_spec.rb", "spec/util_spec.rb", "tasks/load_resource_manifest.rake"]
|
8
|
+
s.authors = [%q{axsh Ltd.}, %q{Masahiro Fujiwara}]
|
9
|
+
s.date = %q{2011-09-20}
|
10
|
+
s.email = [%q{dev@axsh.net}, %q{m-fujiwara@axsh.net}]
|
11
|
+
s.executables = [%q{cli}]
|
12
|
+
s.files = [%q{.gitignore}, %q{LICENSE}, %q{NOTICE}, %q{Rakefile}, %q{bin/cli}, %q{isono.gemspec}, %q{lib/ext/shellwords.rb}, %q{lib/isono.rb}, %q{lib/isono/amqp_client.rb}, %q{lib/isono/daemonize.rb}, %q{lib/isono/event_delegate_context.rb}, %q{lib/isono/event_observable.rb}, %q{lib/isono/logger.rb}, %q{lib/isono/manifest.rb}, %q{lib/isono/messaging_client.rb}, %q{lib/isono/models/event_log.rb}, %q{lib/isono/models/job_state.rb}, %q{lib/isono/models/node_state.rb}, %q{lib/isono/models/resource_instance.rb}, %q{lib/isono/node.rb}, %q{lib/isono/node_modules/base.rb}, %q{lib/isono/node_modules/data_store.rb}, %q{lib/isono/node_modules/event_channel.rb}, %q{lib/isono/node_modules/event_logger.rb}, %q{lib/isono/node_modules/job_channel.rb}, %q{lib/isono/node_modules/job_collector.rb}, %q{lib/isono/node_modules/job_worker.rb}, %q{lib/isono/node_modules/node_collector.rb}, %q{lib/isono/node_modules/node_heartbeat.rb}, %q{lib/isono/node_modules/rpc_channel.rb}, %q{lib/isono/rack.rb}, %q{lib/isono/rack/builder.rb}, %q{lib/isono/rack/data_store.rb}, %q{lib/isono/rack/job.rb}, %q{lib/isono/rack/map.rb}, %q{lib/isono/rack/object_method.rb}, %q{lib/isono/rack/proc.rb}, %q{lib/isono/rack/thread_pass.rb}, %q{lib/isono/resource_manifest.rb}, %q{lib/isono/runner/base.rb}, %q{lib/isono/runner/cli.rb}, %q{lib/isono/runner/rpc_server.rb}, %q{lib/isono/serializer.rb}, %q{lib/isono/thread_pool.rb}, %q{lib/isono/util.rb}, %q{lib/isono/version.rb}, %q{spec/amqp_client_spec.rb}, %q{spec/event_observable_spec.rb}, %q{spec/file_channel_spec.rb}, %q{spec/job_channel_spec.rb}, %q{spec/logger_spec.rb}, %q{spec/manifest_spec.rb}, %q{spec/node_spec.rb}, %q{spec/resource_loader_spec.rb}, %q{spec/rpc_channel_spec.rb}, %q{spec/spec_helper.rb}, %q{spec/thread_pool_spec.rb}, %q{spec/util_spec.rb}, %q{tasks/load_resource_manifest.rake}]
|
14
13
|
s.homepage = %q{http://github.com/axsh/isono}
|
15
|
-
s.require_paths = [
|
14
|
+
s.require_paths = [%q{lib}]
|
16
15
|
s.required_ruby_version = Gem::Requirement.new(">= 1.8.7")
|
17
16
|
s.rubyforge_project = %q{isono}
|
18
|
-
s.rubygems_version = %q{1.6
|
17
|
+
s.rubygems_version = %q{1.8.6}
|
19
18
|
s.summary = %q{Messaging and agent fabric}
|
20
19
|
|
21
20
|
if s.respond_to? :specification_version then
|
@@ -31,6 +31,7 @@ module Isono
|
|
31
31
|
:per_sec_last_response_count=>0,
|
32
32
|
}
|
33
33
|
@endpoints = {}
|
34
|
+
@requested_endpoints = {}
|
34
35
|
@amq = node.create_channel
|
35
36
|
@amq.prefetch(config_section.receiver_prefetch_size.to_i)
|
36
37
|
@amq.queue("command-recv.#{manifest.node_id}", {:exclusive=>true}).subscribe(:ack=>true) { |header, data|
|
@@ -265,6 +266,14 @@ module Isono
|
|
265
266
|
@active_requests[req.ticket] = req
|
266
267
|
end
|
267
268
|
|
269
|
+
# create receiver queue if it is requested at first time
|
270
|
+
# from this node. This allows that the receiver became ready
|
271
|
+
# after the sender can proceed the request.
|
272
|
+
if @requested_endpoints[req.endpoint].nil?
|
273
|
+
amq.queue(endpoint_queue_name(req.endpoint), {:exclusive=>false, :auto_delete=>true})
|
274
|
+
@requested_endpoints[req.endpoint] = 1
|
275
|
+
end
|
276
|
+
|
268
277
|
amq.default_exchange.publish(Serializer.instance.marshal(req.request_hash),
|
269
278
|
{:message_id => req.ticket,
|
270
279
|
:key => endpoint_queue_name(req.endpoint),
|
data/lib/isono/rack/job.rb
CHANGED
@@ -19,6 +19,16 @@ module Rack
|
|
19
19
|
def fail_cb(&blk)
|
20
20
|
@job.fail_cb = blk
|
21
21
|
end
|
22
|
+
|
23
|
+
# Job may run in asynchronous mode. So response() should not
|
24
|
+
# raise error even when it is called multiple times during session.
|
25
|
+
def response(msg)
|
26
|
+
if responded?
|
27
|
+
Job.logger.info("Defered response message from #{@job.job_id}: #{msg}")
|
28
|
+
else
|
29
|
+
super(msg)
|
30
|
+
end
|
31
|
+
end
|
22
32
|
end
|
23
33
|
|
24
34
|
class JobRequest < Request
|
data/lib/isono/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: isono
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 5
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 9
|
10
|
+
version: 0.2.9
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- axsh Ltd.
|
@@ -16,8 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-
|
20
|
-
default_executable: cli
|
19
|
+
date: 2011-09-20 00:00:00 Z
|
21
20
|
dependencies:
|
22
21
|
- !ruby/object:Gem::Dependency
|
23
22
|
name: amqp
|
@@ -181,7 +180,6 @@ files:
|
|
181
180
|
- spec/thread_pool_spec.rb
|
182
181
|
- spec/util_spec.rb
|
183
182
|
- tasks/load_resource_manifest.rake
|
184
|
-
has_rdoc: true
|
185
183
|
homepage: http://github.com/axsh/isono
|
186
184
|
licenses: []
|
187
185
|
|
@@ -213,7 +211,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
213
211
|
requirements: []
|
214
212
|
|
215
213
|
rubyforge_project: isono
|
216
|
-
rubygems_version: 1.6
|
214
|
+
rubygems_version: 1.8.6
|
217
215
|
signing_key:
|
218
216
|
specification_version: 3
|
219
217
|
summary: Messaging and agent fabric
|