expeditor 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/expeditor.gemspec +2 -2
- data/lib/expeditor/command.rb +3 -3
- data/lib/expeditor/rich_future.rb +10 -15
- data/lib/expeditor/services/default.rb +1 -1
- data/lib/expeditor/version.rb +1 -1
- metadata +11 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a3e0a26204eadc9f49c75cfa015a6020120011a
|
4
|
+
data.tar.gz: 4e20d4a96703b331612d9cbb813485828a4646fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 86f57ce4f2e5e9fe0e6e031ce94e15d69f89791d78f493ec1288891d631ddc9360373be663f22240ba4980a0890ccbb5eb6f2954ecd67fb2832b83734c85e166
|
7
|
+
data.tar.gz: 75bff5d919a2c1be17eff4c3768279ada0b87a916239da0125535db32a0c186bcb06abdef5d1eea24190fa87e73d6dc29f1e74a59d2b9d77710c819a13f2a94e
|
data/expeditor.gemspec
CHANGED
@@ -19,8 +19,8 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.add_runtime_dependency "concurrent-ruby", "0.
|
23
|
-
spec.add_runtime_dependency "concurrent-ruby-ext", "0.
|
22
|
+
spec.add_runtime_dependency "concurrent-ruby", "~> 0.9.0"
|
23
|
+
spec.add_runtime_dependency "concurrent-ruby-ext", "~> 0.9.0"
|
24
24
|
spec.add_runtime_dependency "retryable", "> 1.0"
|
25
25
|
|
26
26
|
spec.add_development_dependency "bundler"
|
data/lib/expeditor/command.rb
CHANGED
@@ -115,13 +115,13 @@ module Expeditor
|
|
115
115
|
@fallback_var = Concurrent::IVar.new
|
116
116
|
@normal_future.add_observer do |_, value, reason|
|
117
117
|
if reason != nil
|
118
|
-
future = RichFuture.new(executor: Concurrent.
|
118
|
+
future = RichFuture.new(executor: Concurrent.global_io_executor) do
|
119
119
|
success, val, reason = Concurrent::SafeTaskExecutor.new(block, rescue_exception: true).execute(reason)
|
120
|
-
@fallback_var.complete
|
120
|
+
@fallback_var.send(:complete, success, val, reason)
|
121
121
|
end
|
122
122
|
future.safe_execute
|
123
123
|
else
|
124
|
-
@fallback_var.complete
|
124
|
+
@fallback_var.send(:complete, true, value, nil)
|
125
125
|
end
|
126
126
|
end
|
127
127
|
end
|
@@ -22,7 +22,7 @@ module Expeditor
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def set(v)
|
25
|
-
|
25
|
+
complete(true, v, nil)
|
26
26
|
end
|
27
27
|
|
28
28
|
def safe_set(v)
|
@@ -41,21 +41,16 @@ module Expeditor
|
|
41
41
|
not unscheduled?
|
42
42
|
end
|
43
43
|
|
44
|
-
def safe_execute
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
44
|
+
def safe_execute(*args)
|
45
|
+
if args.empty?
|
46
|
+
begin
|
47
|
+
execute
|
48
|
+
rescue Exception => e
|
49
|
+
fail(e)
|
50
|
+
end
|
51
|
+
else
|
52
|
+
super(*args)
|
49
53
|
end
|
50
54
|
end
|
51
|
-
|
52
|
-
private
|
53
|
-
|
54
|
-
# This is workaround for concurrent-ruby's deadlock bug
|
55
|
-
# see: ruby-concurrency/concurrent-ruby#275
|
56
|
-
def work
|
57
|
-
success, val, reason = Concurrent::SafeTaskExecutor.new(@task, rescue_exception: true).execute(*@args)
|
58
|
-
complete(success, val, reason)
|
59
|
-
end
|
60
55
|
end
|
61
56
|
end
|
data/lib/expeditor/version.rb
CHANGED
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: expeditor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- shohei-yasutake
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-12-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: concurrent-ruby
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.9.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.9.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: concurrent-ruby-ext
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.9.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.9.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: retryable
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -143,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
143
|
version: '0'
|
144
144
|
requirements: []
|
145
145
|
rubyforge_project:
|
146
|
-
rubygems_version: 2.4.5
|
146
|
+
rubygems_version: 2.4.5.1
|
147
147
|
signing_key:
|
148
148
|
specification_version: 4
|
149
149
|
summary: Expeditor provides asynchronous execution and fault tolerance for microservices
|