anachronic 0.43.2 → 0.43.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +6 -0
- data/Gemfile.lock +158 -1
- data/lib/anachronic/background_executor.rb +5 -5
- data/lib/anachronic/executors/application_job.rb +5 -3
- data/lib/anachronic/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1742cd2c69944236145c23ba37f3c9ee355dd02e05913066f6989dd49e95d191
|
4
|
+
data.tar.gz: 8f28901c9c5d7a8c35ac1a84fcac8d0fdb63af3bdd864e353560994e62d71a5c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d088e4b8e592ac8ba3ffb621b4ecd4778fb0d0da77093201ab897ca82c9d8d6a415b5f868b4e0cb5bb7522a33bf5382a60c69f50c3c0326037dbf6d3732c4dc7
|
7
|
+
data.tar.gz: 40741088da5211fa6a19bb254b9238a0c52ce5e3a6f3e0b28b3b49d8d0bfedc3eee9bb3bb2e3e7722cfc0b17b30db5112dc48d57a33f519a9cb3a3efedb2b4c8
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,13 +1,140 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
anachronic (0.43.
|
4
|
+
anachronic (0.43.3)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
|
+
actioncable (6.1.0)
|
10
|
+
actionpack (= 6.1.0)
|
11
|
+
activesupport (= 6.1.0)
|
12
|
+
nio4r (~> 2.0)
|
13
|
+
websocket-driver (>= 0.6.1)
|
14
|
+
actionmailbox (6.1.0)
|
15
|
+
actionpack (= 6.1.0)
|
16
|
+
activejob (= 6.1.0)
|
17
|
+
activerecord (= 6.1.0)
|
18
|
+
activestorage (= 6.1.0)
|
19
|
+
activesupport (= 6.1.0)
|
20
|
+
mail (>= 2.7.1)
|
21
|
+
actionmailer (6.1.0)
|
22
|
+
actionpack (= 6.1.0)
|
23
|
+
actionview (= 6.1.0)
|
24
|
+
activejob (= 6.1.0)
|
25
|
+
activesupport (= 6.1.0)
|
26
|
+
mail (~> 2.5, >= 2.5.4)
|
27
|
+
rails-dom-testing (~> 2.0)
|
28
|
+
actionpack (6.1.0)
|
29
|
+
actionview (= 6.1.0)
|
30
|
+
activesupport (= 6.1.0)
|
31
|
+
rack (~> 2.0, >= 2.0.9)
|
32
|
+
rack-test (>= 0.6.3)
|
33
|
+
rails-dom-testing (~> 2.0)
|
34
|
+
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
35
|
+
actiontext (6.1.0)
|
36
|
+
actionpack (= 6.1.0)
|
37
|
+
activerecord (= 6.1.0)
|
38
|
+
activestorage (= 6.1.0)
|
39
|
+
activesupport (= 6.1.0)
|
40
|
+
nokogiri (>= 1.8.5)
|
41
|
+
actionview (6.1.0)
|
42
|
+
activesupport (= 6.1.0)
|
43
|
+
builder (~> 3.1)
|
44
|
+
erubi (~> 1.4)
|
45
|
+
rails-dom-testing (~> 2.0)
|
46
|
+
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
47
|
+
activejob (6.1.0)
|
48
|
+
activesupport (= 6.1.0)
|
49
|
+
globalid (>= 0.3.6)
|
50
|
+
activemodel (6.1.0)
|
51
|
+
activesupport (= 6.1.0)
|
52
|
+
activerecord (6.1.0)
|
53
|
+
activemodel (= 6.1.0)
|
54
|
+
activesupport (= 6.1.0)
|
55
|
+
activestorage (6.1.0)
|
56
|
+
actionpack (= 6.1.0)
|
57
|
+
activejob (= 6.1.0)
|
58
|
+
activerecord (= 6.1.0)
|
59
|
+
activesupport (= 6.1.0)
|
60
|
+
marcel (~> 0.3.1)
|
61
|
+
mimemagic (~> 0.3.2)
|
62
|
+
activesupport (6.1.0)
|
63
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
64
|
+
i18n (>= 1.6, < 2)
|
65
|
+
minitest (>= 5.1)
|
66
|
+
tzinfo (~> 2.0)
|
67
|
+
zeitwerk (~> 2.3)
|
68
|
+
builder (3.2.4)
|
69
|
+
concurrent-ruby (1.1.7)
|
70
|
+
connection_pool (2.2.3)
|
71
|
+
crass (1.0.6)
|
9
72
|
diff-lcs (1.3)
|
73
|
+
erubi (1.10.0)
|
74
|
+
globalid (0.4.2)
|
75
|
+
activesupport (>= 4.2.0)
|
76
|
+
i18n (1.8.5)
|
77
|
+
concurrent-ruby (~> 1.0)
|
78
|
+
loofah (2.8.0)
|
79
|
+
crass (~> 1.0.2)
|
80
|
+
nokogiri (>= 1.5.9)
|
81
|
+
mail (2.7.1)
|
82
|
+
mini_mime (>= 0.1.1)
|
83
|
+
marcel (0.3.3)
|
84
|
+
mimemagic (~> 0.3.2)
|
85
|
+
method_source (1.0.0)
|
86
|
+
mimemagic (0.3.5)
|
87
|
+
mini_mime (1.0.2)
|
88
|
+
mini_portile2 (2.4.0)
|
89
|
+
minitest (5.14.2)
|
90
|
+
mono_logger (1.1.0)
|
91
|
+
multi_json (1.15.0)
|
92
|
+
mustermann (1.1.1)
|
93
|
+
ruby2_keywords (~> 0.0.1)
|
94
|
+
nio4r (2.5.4)
|
95
|
+
nokogiri (1.10.10)
|
96
|
+
mini_portile2 (~> 2.4.0)
|
97
|
+
rack (2.2.3)
|
98
|
+
rack-protection (2.1.0)
|
99
|
+
rack
|
100
|
+
rack-test (1.1.0)
|
101
|
+
rack (>= 1.0, < 3)
|
102
|
+
rails (6.1.0)
|
103
|
+
actioncable (= 6.1.0)
|
104
|
+
actionmailbox (= 6.1.0)
|
105
|
+
actionmailer (= 6.1.0)
|
106
|
+
actionpack (= 6.1.0)
|
107
|
+
actiontext (= 6.1.0)
|
108
|
+
actionview (= 6.1.0)
|
109
|
+
activejob (= 6.1.0)
|
110
|
+
activemodel (= 6.1.0)
|
111
|
+
activerecord (= 6.1.0)
|
112
|
+
activestorage (= 6.1.0)
|
113
|
+
activesupport (= 6.1.0)
|
114
|
+
bundler (>= 1.15.0)
|
115
|
+
railties (= 6.1.0)
|
116
|
+
sprockets-rails (>= 2.0.0)
|
117
|
+
rails-dom-testing (2.0.3)
|
118
|
+
activesupport (>= 4.2.0)
|
119
|
+
nokogiri (>= 1.6)
|
120
|
+
rails-html-sanitizer (1.3.0)
|
121
|
+
loofah (~> 2.3)
|
122
|
+
railties (6.1.0)
|
123
|
+
actionpack (= 6.1.0)
|
124
|
+
activesupport (= 6.1.0)
|
125
|
+
method_source
|
126
|
+
rake (>= 0.8.7)
|
127
|
+
thor (~> 1.0)
|
10
128
|
rake (12.3.3)
|
129
|
+
redis (4.2.5)
|
130
|
+
redis-namespace (1.8.0)
|
131
|
+
redis (>= 3.0.4)
|
132
|
+
resque (2.0.0)
|
133
|
+
mono_logger (~> 1.0)
|
134
|
+
multi_json (~> 1.0)
|
135
|
+
redis-namespace (~> 1.6)
|
136
|
+
sinatra (>= 0.9.2)
|
137
|
+
vegas (~> 0.1.2)
|
11
138
|
rspec (3.8.0)
|
12
139
|
rspec-core (~> 3.8.0)
|
13
140
|
rspec-expectations (~> 3.8.0)
|
@@ -21,14 +148,44 @@ GEM
|
|
21
148
|
diff-lcs (>= 1.2.0, < 2.0)
|
22
149
|
rspec-support (~> 3.8.0)
|
23
150
|
rspec-support (3.8.0)
|
151
|
+
ruby2_keywords (0.0.2)
|
152
|
+
sidekiq (6.1.2)
|
153
|
+
connection_pool (>= 2.2.2)
|
154
|
+
rack (~> 2.0)
|
155
|
+
redis (>= 4.2.0)
|
156
|
+
sinatra (2.1.0)
|
157
|
+
mustermann (~> 1.0)
|
158
|
+
rack (~> 2.2)
|
159
|
+
rack-protection (= 2.1.0)
|
160
|
+
tilt (~> 2.0)
|
161
|
+
sprockets (4.0.2)
|
162
|
+
concurrent-ruby (~> 1.0)
|
163
|
+
rack (> 1, < 3)
|
164
|
+
sprockets-rails (3.2.2)
|
165
|
+
actionpack (>= 4.0)
|
166
|
+
activesupport (>= 4.0)
|
167
|
+
sprockets (>= 3.0.0)
|
168
|
+
thor (1.0.1)
|
169
|
+
tilt (2.0.10)
|
170
|
+
tzinfo (2.0.4)
|
171
|
+
concurrent-ruby (~> 1.0)
|
172
|
+
vegas (0.1.11)
|
173
|
+
rack (>= 1.0.0)
|
174
|
+
websocket-driver (0.7.3)
|
175
|
+
websocket-extensions (>= 0.1.0)
|
176
|
+
websocket-extensions (0.1.5)
|
177
|
+
zeitwerk (2.4.2)
|
24
178
|
|
25
179
|
PLATFORMS
|
26
180
|
ruby
|
27
181
|
|
28
182
|
DEPENDENCIES
|
29
183
|
anachronic!
|
184
|
+
rails (~> 6.1)
|
30
185
|
rake (~> 12.0)
|
186
|
+
resque (~> 2.0)
|
31
187
|
rspec (~> 3.0)
|
188
|
+
sidekiq (~> 6.0)
|
32
189
|
|
33
190
|
BUNDLED WITH
|
34
191
|
2.1.4
|
@@ -19,18 +19,18 @@ module Anachronic
|
|
19
19
|
|
20
20
|
def executor
|
21
21
|
@executor ||= begin
|
22
|
-
return Executors::Sidekiq if
|
23
|
-
return Executors::ApplicationJob if
|
24
|
-
return Executors::Resque if
|
22
|
+
return Anachronic::Executors::Sidekiq if defined?('Sidekiq')
|
23
|
+
return Anachronic::Executors::ApplicationJob if defined?('ApplicationJob')
|
24
|
+
return Anachronic::Executors::Resque if defined?('Resque')
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
28
28
|
def default_or_defined?(name)
|
29
|
-
defined?(name) || config.default_executor == name
|
29
|
+
defined?(name.constantize) || config.default_executor.name == name
|
30
30
|
end
|
31
31
|
|
32
32
|
def no_executor
|
33
|
-
raise
|
33
|
+
raise Error('No background executor found')
|
34
34
|
end
|
35
35
|
end
|
36
36
|
end
|
@@ -6,11 +6,13 @@ module Anachronic
|
|
6
6
|
class ApplicationJob
|
7
7
|
class << self
|
8
8
|
def call(instance, method, *args)
|
9
|
-
|
9
|
+
executor.perform_later(instance, method, *args)
|
10
10
|
end
|
11
11
|
|
12
|
-
def
|
13
|
-
@
|
12
|
+
def executor
|
13
|
+
@executor ||= begin
|
14
|
+
return unless defined? Applicationjob
|
15
|
+
|
14
16
|
Class.new(ApplicationJob) do
|
15
17
|
def perform_later(instance, method, *args)
|
16
18
|
instance.public_send(method, *args)
|
data/lib/anachronic/version.rb
CHANGED