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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9545876fd08d33f5578deccef8bfffd39564c014
4
- data.tar.gz: 2b1b2e2e586ac117986965c832326c0398104cae
3
+ metadata.gz: 3a3e0a26204eadc9f49c75cfa015a6020120011a
4
+ data.tar.gz: 4e20d4a96703b331612d9cbb813485828a4646fc
5
5
  SHA512:
6
- metadata.gz: 1ed11e18c6a4c20cf6c80b2beb36481680776b52a167789178b29dc5038368df370b9eb8f58c42fddeeb06f4870ffc0f64fbfb1659a4a1ae000b4365a4df87b5
7
- data.tar.gz: ddda85a097bf8cebdb050870d6cdc9b76edd6d37158dbed2f5da6ef69abba40679894e6e13b60576c4f0949aebb529be7d8ba369a4497334ac659ed542d38c56
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.8.0"
23
- spec.add_runtime_dependency "concurrent-ruby-ext", "0.8.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"
@@ -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.configuration.global_task_pool) do
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(success, val, reason)
120
+ @fallback_var.send(:complete, success, val, reason)
121
121
  end
122
122
  future.safe_execute
123
123
  else
124
- @fallback_var.complete(true, value, nil)
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
- super(v)
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
- begin
46
- execute
47
- rescue Exception => e
48
- fail(e)
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
@@ -5,7 +5,7 @@ module Expeditor
5
5
  module Services
6
6
  class Default < Expeditor::Service
7
7
  def initialize
8
- @executor = Concurrent.configuration.global_task_pool
8
+ @executor = Concurrent.global_io_executor
9
9
  @bucket = nil
10
10
  end
11
11
 
@@ -1,3 +1,3 @@
1
1
  module Expeditor
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
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.1.1
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-07-15 00:00:00.000000000 Z
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.8.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.8.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.8.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.8.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