worker-glass 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/.travis.yml +1 -0
- data/Gemfile.lock +30 -33
- data/README.md +2 -2
- data/lib/worker_glass/timeout.rb +1 -0
- data/lib/worker_glass/version.rb +2 -1
- data/worker-glass.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: dbf4dfacf5492898da2958ab96cf2e412d5719cd
|
|
4
|
+
data.tar.gz: 9c6ae556430b159b083fe4c96a8dd8ed592a69eb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 62822676b6558be3229c792316bd0bffcec1149f3f65504c2229e64180688e87c00de58a89195eaaa0865bf2c698d0ec788ab2cfab934ed11b907c3cb795c0ee
|
|
7
|
+
data.tar.gz: 74012f663fc8c8411bae82a36c0f726ec28e2684e603f9a768211c9faa30313f96bd6cf315ff78ffd3b0576cd6e27444a5fcf16d6246c6eae4fffb05c395c77e
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.
|
|
1
|
+
2.3.0
|
data/.travis.yml
CHANGED
data/Gemfile.lock
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
PATH
|
|
2
2
|
remote: .
|
|
3
3
|
specs:
|
|
4
|
-
worker-glass (0.2.
|
|
4
|
+
worker-glass (0.2.1)
|
|
5
5
|
activesupport
|
|
6
6
|
null-logger
|
|
7
7
|
|
|
@@ -9,10 +9,10 @@ GEM
|
|
|
9
9
|
remote: https://rubygems.org/
|
|
10
10
|
specs:
|
|
11
11
|
abstract_type (0.0.7)
|
|
12
|
-
activemodel (4.2.5)
|
|
13
|
-
activesupport (= 4.2.5)
|
|
12
|
+
activemodel (4.2.5.1)
|
|
13
|
+
activesupport (= 4.2.5.1)
|
|
14
14
|
builder (~> 3.1)
|
|
15
|
-
activesupport (4.2.5)
|
|
15
|
+
activesupport (4.2.5.1)
|
|
16
16
|
i18n (~> 0.7)
|
|
17
17
|
json (~> 1.7, >= 1.7.7)
|
|
18
18
|
minitest (~> 5.1)
|
|
@@ -21,14 +21,12 @@ GEM
|
|
|
21
21
|
adamantium (0.2.0)
|
|
22
22
|
ice_nine (~> 0.11.0)
|
|
23
23
|
memoizable (~> 0.4.0)
|
|
24
|
-
ast (2.
|
|
25
|
-
astrolabe (1.3.1)
|
|
26
|
-
parser (~> 2.2)
|
|
24
|
+
ast (2.2.0)
|
|
27
25
|
axiom-types (0.1.1)
|
|
28
26
|
descendants_tracker (~> 0.0.4)
|
|
29
27
|
ice_nine (~> 0.11.0)
|
|
30
28
|
thread_safe (~> 0.3, >= 0.3.1)
|
|
31
|
-
brakeman (3.1.
|
|
29
|
+
brakeman (3.1.4)
|
|
32
30
|
erubis (~> 2.6)
|
|
33
31
|
fastercsv (~> 1.5)
|
|
34
32
|
haml (>= 3.0, < 5.0)
|
|
@@ -40,13 +38,14 @@ GEM
|
|
|
40
38
|
sass (~> 3.0)
|
|
41
39
|
slim (>= 1.3.6, < 4.0)
|
|
42
40
|
terminal-table (~> 1.4)
|
|
43
|
-
bson (4.0.
|
|
41
|
+
bson (4.0.1)
|
|
44
42
|
builder (3.2.2)
|
|
45
43
|
codeclimate-engine-rb (0.1.0)
|
|
46
44
|
virtus (~> 1.0)
|
|
47
45
|
coderay (1.1.0)
|
|
48
46
|
coercible (1.0.0)
|
|
49
47
|
descendants_tracker (~> 0.0.1)
|
|
48
|
+
colorize (0.7.7)
|
|
50
49
|
concord (0.1.5)
|
|
51
50
|
adamantium (~> 0.2.0)
|
|
52
51
|
equalizer (~> 0.0.9)
|
|
@@ -78,10 +77,10 @@ GEM
|
|
|
78
77
|
memoizable (0.4.2)
|
|
79
78
|
thread_safe (~> 0.3, >= 0.3.1)
|
|
80
79
|
method_source (0.8.2)
|
|
81
|
-
minitest (5.8.
|
|
82
|
-
mongo (2.2.
|
|
80
|
+
minitest (5.8.4)
|
|
81
|
+
mongo (2.2.2)
|
|
83
82
|
bson (~> 4.0)
|
|
84
|
-
mongoid (5.0.
|
|
83
|
+
mongoid (5.0.2)
|
|
85
84
|
activemodel (~> 4.0)
|
|
86
85
|
mongo (~> 2.1)
|
|
87
86
|
origin (~> 2.1)
|
|
@@ -92,9 +91,9 @@ GEM
|
|
|
92
91
|
rspec (~> 3.3)
|
|
93
92
|
multi_json (1.11.2)
|
|
94
93
|
null-logger (0.1.0)
|
|
95
|
-
origin (2.
|
|
96
|
-
parser (2.
|
|
97
|
-
ast (
|
|
94
|
+
origin (2.2.0)
|
|
95
|
+
parser (2.3.0.2)
|
|
96
|
+
ast (~> 2.2)
|
|
98
97
|
polishgeeks-dev-tools (1.2.1)
|
|
99
98
|
brakeman
|
|
100
99
|
faker
|
|
@@ -115,9 +114,9 @@ GEM
|
|
|
115
114
|
coderay (~> 1.1.0)
|
|
116
115
|
method_source (~> 0.8.1)
|
|
117
116
|
slop (~> 3.4)
|
|
118
|
-
rainbow (2.
|
|
119
|
-
rake (10.
|
|
120
|
-
reek (3.
|
|
117
|
+
rainbow (2.1.0)
|
|
118
|
+
rake (10.5.0)
|
|
119
|
+
reek (3.8.1)
|
|
121
120
|
codeclimate-engine-rb (~> 0.1.0)
|
|
122
121
|
parser (~> 2.2, >= 2.2.2.5)
|
|
123
122
|
private_attr (~> 1.1)
|
|
@@ -132,32 +131,31 @@ GEM
|
|
|
132
131
|
rspec-expectations (3.4.0)
|
|
133
132
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
134
133
|
rspec-support (~> 3.4.0)
|
|
135
|
-
rspec-mocks (3.4.
|
|
134
|
+
rspec-mocks (3.4.1)
|
|
136
135
|
diff-lcs (>= 1.2.0, < 2.0)
|
|
137
136
|
rspec-support (~> 3.4.0)
|
|
138
137
|
rspec-support (3.4.1)
|
|
139
|
-
rubocop (0.
|
|
140
|
-
|
|
141
|
-
parser (>= 2.2.3.0, < 3.0)
|
|
138
|
+
rubocop (0.36.0)
|
|
139
|
+
parser (>= 2.3.0.0, < 3.0)
|
|
142
140
|
powerpack (~> 0.1)
|
|
143
141
|
rainbow (>= 1.99.1, < 3.0)
|
|
144
142
|
ruby-progressbar (~> 1.7)
|
|
145
|
-
tins (<= 1.6.0)
|
|
146
143
|
ruby-progressbar (1.7.5)
|
|
147
144
|
ruby2ruby (2.2.0)
|
|
148
145
|
ruby_parser (~> 3.1)
|
|
149
146
|
sexp_processor (~> 4.0)
|
|
150
|
-
ruby_parser (3.7.
|
|
147
|
+
ruby_parser (3.7.3)
|
|
151
148
|
sexp_processor (~> 4.1)
|
|
152
|
-
rubycritic (2.
|
|
149
|
+
rubycritic (2.6.0)
|
|
150
|
+
colorize
|
|
153
151
|
flay (= 2.6.1)
|
|
154
152
|
flog (= 4.3.2)
|
|
155
153
|
parser (>= 2.2.0, < 3.0)
|
|
156
|
-
reek (= 3.
|
|
154
|
+
reek (= 3.8.1)
|
|
157
155
|
virtus (~> 1.0)
|
|
158
156
|
safe_yaml (1.0.4)
|
|
159
|
-
sass (3.4.
|
|
160
|
-
sexp_processor (4.6.
|
|
157
|
+
sass (3.4.21)
|
|
158
|
+
sexp_processor (4.6.1)
|
|
161
159
|
shoulda (3.5.0)
|
|
162
160
|
shoulda-context (~> 1.0, >= 1.0.1)
|
|
163
161
|
shoulda-matchers (>= 1.4.1, < 3.0)
|
|
@@ -177,18 +175,17 @@ GEM
|
|
|
177
175
|
temple (0.7.6)
|
|
178
176
|
terminal-table (1.5.2)
|
|
179
177
|
thread_safe (0.3.5)
|
|
180
|
-
tilt (2.0.
|
|
178
|
+
tilt (2.0.2)
|
|
181
179
|
timecop (0.8.0)
|
|
182
|
-
tins (1.6.0)
|
|
183
180
|
tzinfo (1.2.2)
|
|
184
181
|
thread_safe (~> 0.1)
|
|
185
|
-
unparser (0.2.
|
|
182
|
+
unparser (0.2.5)
|
|
186
183
|
abstract_type (~> 0.0.7)
|
|
187
184
|
adamantium (~> 0.2.0)
|
|
188
185
|
concord (~> 0.1.5)
|
|
189
186
|
diff-lcs (~> 1.2.5)
|
|
190
187
|
equalizer (~> 0.0.9)
|
|
191
|
-
parser (~> 2.
|
|
188
|
+
parser (~> 2.3.0)
|
|
192
189
|
procto (~> 0.0.2)
|
|
193
190
|
virtus (1.0.5)
|
|
194
191
|
axiom-types (~> 0.1)
|
|
@@ -205,4 +202,4 @@ DEPENDENCIES
|
|
|
205
202
|
worker-glass!
|
|
206
203
|
|
|
207
204
|
BUNDLED WITH
|
|
208
|
-
1.
|
|
205
|
+
1.11.2
|
data/README.md
CHANGED
|
@@ -34,7 +34,7 @@ WorkerGlass has few submodules that you can prepend to your workers to obtain gi
|
|
|
34
34
|
If you want to provide timeouts for your workers, just prepend WorkerGlass::Timeout to your worker and set the timeout value:
|
|
35
35
|
|
|
36
36
|
```ruby
|
|
37
|
-
class Worker2
|
|
37
|
+
class Worker2
|
|
38
38
|
prepend WorkerGlass::Timeout
|
|
39
39
|
|
|
40
40
|
self.timeout = 60 # 1 minute timeout
|
|
@@ -52,7 +52,7 @@ Worker2.perform_async(example1, example2, example3)
|
|
|
52
52
|
If you want to provide reentrancy for your workers, just include WorkerGlass::Reentrancy to your worker and define **after_failure** method that will be executed uppon failure:
|
|
53
53
|
|
|
54
54
|
```ruby
|
|
55
|
-
class Worker3
|
|
55
|
+
class Worker3
|
|
56
56
|
include WorkerGlass::Reentrancy
|
|
57
57
|
|
|
58
58
|
def perform(first_param, second_param, third_param)
|
data/lib/worker_glass/timeout.rb
CHANGED
|
@@ -23,6 +23,7 @@ module WorkerGlass
|
|
|
23
23
|
# @raise [WorkerGlass::Errors::TimeoutNotDefined] if we didn't define timeout
|
|
24
24
|
def perform(*args)
|
|
25
25
|
fail Errors::TimeoutNotDefined unless self.class.timeout
|
|
26
|
+
|
|
26
27
|
::Timeout.timeout(self.class.timeout, Errors::TimeoutError) { super }
|
|
27
28
|
end
|
|
28
29
|
end
|
data/lib/worker_glass/version.rb
CHANGED
data/worker-glass.gemspec
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: worker-glass
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Maciej Mensfeld
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date:
|
|
12
|
+
date: 2016-01-26 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: null-logger
|
|
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
84
84
|
version: '0'
|
|
85
85
|
requirements: []
|
|
86
86
|
rubyforge_project:
|
|
87
|
-
rubygems_version: 2.
|
|
87
|
+
rubygems_version: 2.5.1
|
|
88
88
|
signing_key:
|
|
89
89
|
specification_version: 4
|
|
90
90
|
summary: Timeout and Reentrancy for your background processing workers!
|