asynchronic 3.0.1 → 3.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +6 -10
- data/README.md +0 -1
- data/asynchronic.gemspec +1 -2
- data/lib/asynchronic/process.rb +7 -8
- data/lib/asynchronic/version.rb +1 -1
- data/spec/process/life_cycle_examples.rb +1 -1
- metadata +5 -20
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 17e77f96cb1792507a8d82d9745bbf766c484cf4308bf41e268f33b28fb7671c
|
4
|
+
data.tar.gz: 33e566a52873e57adb7f79db2cfc179a269bf990ac57d9c0db3ebe698800c42d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fac5b943ac35aa8d40ea3ec3bf73f3a827ecc6e040814c958a5a17f5d44a3bed544aa8956db5e7679b32cb9f2ccde5a859f20e3e0f150e85fe5d52fec6936dee
|
7
|
+
data.tar.gz: 70750e88c0c4a3ac3647c1d98bccd9e70447c92c226a11829175153c2bcf401e77ee07aff82b702cf8aee8db4c6961b0bf7e467304060592a176be0c29d3755c
|
data/.travis.yml
CHANGED
@@ -4,12 +4,12 @@ rvm:
|
|
4
4
|
- 2.0
|
5
5
|
- 2.1
|
6
6
|
- 2.2
|
7
|
-
- 2.3
|
8
|
-
- 2.4
|
9
|
-
- 2.5
|
10
|
-
- 2.6
|
11
|
-
-
|
12
|
-
- jruby-9.2.
|
7
|
+
- 2.3
|
8
|
+
- 2.4
|
9
|
+
- 2.5
|
10
|
+
- 2.6
|
11
|
+
- 2.7
|
12
|
+
- jruby-9.2.9.0
|
13
13
|
- ruby-head
|
14
14
|
- jruby-head
|
15
15
|
|
@@ -19,9 +19,5 @@ matrix:
|
|
19
19
|
- rvm: ruby-head
|
20
20
|
- rvm: jruby-head
|
21
21
|
|
22
|
-
before_install:
|
23
|
-
- rvm all-gemsets do gem uninstall bundler -ax || true
|
24
|
-
- gem install bundler -v "< 2"
|
25
|
-
|
26
22
|
services:
|
27
23
|
- redis-server
|
data/README.md
CHANGED
@@ -4,7 +4,6 @@
|
|
4
4
|
[![Build Status](https://travis-ci.org/gabynaiman/asynchronic.svg?branch=master)](https://travis-ci.org/gabynaiman/asynchronic)
|
5
5
|
[![Coverage Status](https://coveralls.io/repos/gabynaiman/asynchronic/badge.svg?branch=master)](https://coveralls.io/r/gabynaiman/asynchronic?branch=master)
|
6
6
|
[![Code Climate](https://codeclimate.com/github/gabynaiman/asynchronic.svg)](https://codeclimate.com/github/gabynaiman/asynchronic)
|
7
|
-
[![Dependency Status](https://gemnasium.com/gabynaiman/asynchronic.svg)](https://gemnasium.com/gabynaiman/asynchronic)
|
8
7
|
|
9
8
|
DSL for asynchronic pipeline using queues over Redis
|
10
9
|
|
data/asynchronic.gemspec
CHANGED
@@ -24,8 +24,7 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_dependency 'transparent_proxy', '~> 0.0'
|
25
25
|
spec.add_dependency 'multi_require', '~> 1.0'
|
26
26
|
|
27
|
-
spec.add_development_dependency '
|
28
|
-
spec.add_development_dependency 'rake', '~> 11.0'
|
27
|
+
spec.add_development_dependency 'rake', '~> 12.0'
|
29
28
|
spec.add_development_dependency 'minitest', '~> 5.0', '< 5.11'
|
30
29
|
spec.add_development_dependency 'minitest-great_expectations', '~> 0.0'
|
31
30
|
spec.add_development_dependency 'minitest-stub_any_instance', '~> 1.0'
|
data/lib/asynchronic/process.rb
CHANGED
@@ -13,6 +13,7 @@ module Asynchronic
|
|
13
13
|
|
14
14
|
ATTRIBUTE_NAMES = [:type, :name, :queue, :status, :dependencies, :data, :result, :error, :connection_name] | TIME_TRACKING_MAP.values.uniq
|
15
15
|
|
16
|
+
AUTOMATIC_ABORTED_ERROR_MESSAGE = 'Automatic aborted before execution'
|
16
17
|
CANCELED_ERROR_MESSAGE = 'Canceled'
|
17
18
|
DEAD_ERROR_MESSAGE = 'Process connection broken'
|
18
19
|
|
@@ -97,13 +98,11 @@ module Asynchronic
|
|
97
98
|
end
|
98
99
|
|
99
100
|
def real_error
|
100
|
-
return nil
|
101
|
+
return nil if !aborted?
|
101
102
|
|
102
|
-
processes.
|
103
|
-
return child.real_error if child.error
|
104
|
-
end
|
103
|
+
first_aborted_child = processes.select(&:aborted?).sort_by(&:finalized_at).first
|
105
104
|
|
106
|
-
error.message
|
105
|
+
first_aborted_child ? first_aborted_child.real_error : error.message
|
107
106
|
end
|
108
107
|
|
109
108
|
def dependencies
|
@@ -215,8 +214,8 @@ module Asynchronic
|
|
215
214
|
end
|
216
215
|
end
|
217
216
|
|
218
|
-
def abort!(exception
|
219
|
-
self.error = Error.new exception
|
217
|
+
def abort!(exception)
|
218
|
+
self.error = Error.new exception
|
220
219
|
aborted!
|
221
220
|
end
|
222
221
|
|
@@ -224,7 +223,7 @@ module Asynchronic
|
|
224
223
|
self.connection_name = Asynchronic.connection_name
|
225
224
|
|
226
225
|
if root.aborted?
|
227
|
-
abort!
|
226
|
+
abort! AUTOMATIC_ABORTED_ERROR_MESSAGE
|
228
227
|
else
|
229
228
|
running!
|
230
229
|
self.result = job.call
|
data/lib/asynchronic/version.rb
CHANGED
@@ -592,6 +592,7 @@ module LifeCycleExamples
|
|
592
592
|
'AbortQueuedAfterErrorJob::Child_4' => :aborted
|
593
593
|
|
594
594
|
process.real_error.must_equal 'Forced error'
|
595
|
+
process.processes[0].processes[1].error.message.must_equal Asynchronic::Process::AUTOMATIC_ABORTED_ERROR_MESSAGE
|
595
596
|
end
|
596
597
|
|
597
598
|
it 'Manual abort' do
|
@@ -762,5 +763,4 @@ module LifeCycleExamples
|
|
762
763
|
queue.must_be_empty
|
763
764
|
end
|
764
765
|
|
765
|
-
|
766
766
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asynchronic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0.
|
4
|
+
version: 3.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gabriel Naiman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ost
|
@@ -80,34 +80,20 @@ dependencies:
|
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: '1.0'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: bundler
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '1.12'
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - "~>"
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: '1.12'
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: rake
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
100
86
|
requirements:
|
101
87
|
- - "~>"
|
102
88
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
89
|
+
version: '12.0'
|
104
90
|
type: :development
|
105
91
|
prerelease: false
|
106
92
|
version_requirements: !ruby/object:Gem::Requirement
|
107
93
|
requirements:
|
108
94
|
- - "~>"
|
109
95
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
96
|
+
version: '12.0'
|
111
97
|
- !ruby/object:Gem::Dependency
|
112
98
|
name: minitest
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -305,8 +291,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
305
291
|
- !ruby/object:Gem::Version
|
306
292
|
version: '0'
|
307
293
|
requirements: []
|
308
|
-
|
309
|
-
rubygems_version: 2.6.8
|
294
|
+
rubygems_version: 3.0.6
|
310
295
|
signing_key:
|
311
296
|
specification_version: 4
|
312
297
|
summary: DSL for asynchronic pipeline using queues over Redis
|