delayed 0.5.1 → 0.5.2

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
  SHA256:
3
- metadata.gz: ace621cdafc8489809a02bcd03d0367f686b7bc1d9eba634263595da038b559f
4
- data.tar.gz: 25b7047017850106283822f0ce6ef89c93b53e81303591b47772c121b3ec7eb9
3
+ metadata.gz: ac86a8d4576b55da967457fefbe6576b1cb2aa894d1015bd4e9883beb25a14cf
4
+ data.tar.gz: 1db2668da101214ff8ad304931de54a5b348a54dee991eac6535fd117a14af90
5
5
  SHA512:
6
- metadata.gz: abc7e1858bb94efaa865df785abd79818d107952821e83830d8dc16a6415d506f50316a851fb01bf1182753e3f71565381e0b1c54a5ad9481123d46fadc2a283
7
- data.tar.gz: 7eeaa1c9e12d6fc78345a29f8fb99ef5f6aa956bae5923fe94a0c78358247fbd581f96a07fcf9b33e79ff86ad06f78b357eba14e8d9638f1152fd39d139942ea
6
+ metadata.gz: b07f547dbc8087465a79dbad0e75170d720d7f942b573dab337666f244ace82f2de08b52aee12e20038ec88594a103385de21abf3f439aabe4e2404bdf45d75a
7
+ data.tar.gz: d2144160713def9d49398a99cb99e3def26cc5beea91d9f0ee832533ba91569b9c9642e00de44ce23eb4e85318c3bbaf34b02f4f478fb3dd85340d0eff09f627
@@ -36,34 +36,4 @@ module Delayed
36
36
  end
37
37
  end
38
38
  end
39
-
40
- class JobWrapper # rubocop:disable Betterment/ActiveJobPerformable
41
- attr_accessor :job_data
42
-
43
- delegate_missing_to :job
44
-
45
- def initialize(job_data)
46
- @job_data = job_data
47
- end
48
-
49
- def display_name
50
- job_data['job_class']
51
- end
52
-
53
- def perform
54
- ActiveJob::Callbacks.run_callbacks(:execute) do
55
- job.perform_now
56
- end
57
- end
58
-
59
- def encode_with(coder)
60
- coder['job_data'] = @job_data
61
- end
62
-
63
- private
64
-
65
- def job
66
- @job ||= ActiveJob::Base.deserialize(job_data) if job_data
67
- end
68
- end
69
39
  end
@@ -0,0 +1,31 @@
1
+ module Delayed
2
+ class JobWrapper # rubocop:disable Betterment/ActiveJobPerformable
3
+ attr_accessor :job_data
4
+
5
+ delegate_missing_to :job
6
+
7
+ def initialize(job_data)
8
+ @job_data = job_data
9
+ end
10
+
11
+ def display_name
12
+ job_data['job_class']
13
+ end
14
+
15
+ def perform
16
+ ActiveJob::Callbacks.run_callbacks(:execute) do
17
+ job.perform_now
18
+ end
19
+ end
20
+
21
+ def encode_with(coder)
22
+ coder['job_data'] = @job_data
23
+ end
24
+
25
+ private
26
+
27
+ def job
28
+ @job ||= ActiveJob::Base.deserialize(job_data) if job_data
29
+ end
30
+ end
31
+ end
data/lib/delayed.rb CHANGED
@@ -14,6 +14,7 @@ require 'delayed/plugins/instrumentation'
14
14
  require 'delayed/backend/base'
15
15
  require 'delayed/backend/job_preparer'
16
16
  require 'delayed/worker'
17
+ require 'delayed/job_wrapper'
17
18
 
18
19
  if defined?(Rails::Engine)
19
20
  require 'delayed/engine'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: delayed
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nathan Griffith
@@ -19,7 +19,7 @@ authors:
19
19
  autorequire:
20
20
  bindir: bin
21
21
  cert_chain: []
22
- date: 2023-10-11 00:00:00.000000000 Z
22
+ date: 2023-10-19 00:00:00.000000000 Z
23
23
  dependencies:
24
24
  - !ruby/object:Gem::Dependency
25
25
  name: activerecord
@@ -72,6 +72,7 @@ files:
72
72
  - lib/delayed/backend/job_preparer.rb
73
73
  - lib/delayed/engine.rb
74
74
  - lib/delayed/exceptions.rb
75
+ - lib/delayed/job_wrapper.rb
75
76
  - lib/delayed/lifecycle.rb
76
77
  - lib/delayed/message_sending.rb
77
78
  - lib/delayed/monitor.rb