kicks 3.1.0 → 3.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog.md +7 -3
- data/kicks.gemspec +2 -2
- data/lib/active_job/queue_adapters/sneakers_adapter.rb +30 -28
- data/lib/sneakers/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ccc9ea63784a73fbeddcce04080502702a7313867998bd41ef1322654a97a88
|
4
|
+
data.tar.gz: f986416420a86a75817fa8ae44750543349b19d1cce5db162d68da9c7d261f8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ff97a24291dde8fb237d6e54318de1dfdf53a40361dc4172ec117a93027ffc49082e5c041a46617c628073004367985cfc866be356e7592e6fd5913e57ac2a1c
|
7
|
+
data.tar.gz: 819e52775f26c55fede5697467cd7154db41e5ce86f7e00eddeb260e8b1f0e922688bb241b4c71e08fb0a17f98541989fa23963867fd4cbaab6d8f7f2a20339c
|
data/ChangeLog.md
CHANGED
@@ -1,8 +1,12 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
## Changes Between 3.1.0 and 3.
|
3
|
+
## Changes Between 3.1.0 and 3.1.1 (Nov 1, 2024)
|
4
4
|
|
5
|
-
|
5
|
+
### ActiveJob Adapter Compatibility with Ruby on Rails Older Than 7.2
|
6
|
+
|
7
|
+
Contributed by @dixpac.
|
8
|
+
|
9
|
+
GitHub issue: [#19](https://github.com/ruby-amqp/kicks/pull/19)
|
6
10
|
|
7
11
|
|
8
12
|
## Changes Between 3.0.0 and 3.1.0 (Oct 20, 2024)
|
@@ -11,7 +15,7 @@ No changes yet.
|
|
11
15
|
|
12
16
|
Kicks now ships with an ActiveJob adapter for Ruby on Rails.
|
13
17
|
|
14
|
-
Contributed by dixpac.
|
18
|
+
Contributed by @dixpac.
|
15
19
|
|
16
20
|
GitHub issue: [#12](https://github.com/ruby-amqp/kicks/pull/12)
|
17
21
|
|
data/kicks.gemspec
CHANGED
@@ -31,8 +31,8 @@ Gem::Specification.new do |gem|
|
|
31
31
|
gem.add_dependency 'rake', '>= 12.3', '< 14.0'
|
32
32
|
|
33
33
|
# for integration environment (see .travis.yml and integration_spec)
|
34
|
-
gem.add_development_dependency 'activejob', '>= 7.
|
35
|
-
gem.add_development_dependency 'activesupport', '>= 7.
|
34
|
+
gem.add_development_dependency 'activejob', '>= 7.2'
|
35
|
+
gem.add_development_dependency 'activesupport', '>= 7.2'
|
36
36
|
gem.add_development_dependency 'rabbitmq_http_api_client'
|
37
37
|
gem.add_development_dependency 'redis'
|
38
38
|
|
@@ -1,37 +1,39 @@
|
|
1
|
-
|
2
|
-
module
|
3
|
-
|
4
|
-
|
1
|
+
if defined?(ActiveJob) && ActiveJob.version >= "7.2"
|
2
|
+
module ActiveJob
|
3
|
+
module QueueAdapters
|
4
|
+
# Explicitly remove the implementation existing in older Rails versions'.
|
5
|
+
remove_const(:SneakersAdapter) if defined?("::#{name}::SneakersAdapter")
|
5
6
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
7
|
+
# = Sneakers adapter for Active Job
|
8
|
+
#
|
9
|
+
# To use Sneakers set the queue_adapter config to +:sneakers+.
|
10
|
+
#
|
11
|
+
# Rails.application.config.active_job.queue_adapter = :sneakers
|
12
|
+
class SneakersAdapter < ::ActiveJob::QueueAdapters::AbstractAdapter
|
13
|
+
def initialize
|
14
|
+
@monitor = Monitor.new
|
15
|
+
end
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
def enqueue(job)
|
18
|
+
@monitor.synchronize do
|
19
|
+
JobWrapper.from_queue job.queue_name
|
20
|
+
JobWrapper.enqueue ActiveSupport::JSON.encode(job.serialize)
|
21
|
+
end
|
20
22
|
end
|
21
|
-
end
|
22
23
|
|
23
|
-
|
24
|
-
|
25
|
-
|
24
|
+
def enqueue_at(job, timestamp)
|
25
|
+
raise NotImplementedError, 'This queueing backend does not support scheduling jobs.'
|
26
|
+
end
|
26
27
|
|
27
|
-
|
28
|
-
|
29
|
-
|
28
|
+
class JobWrapper
|
29
|
+
include Sneakers::Worker
|
30
|
+
from_queue 'default'
|
30
31
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
32
|
+
def work(msg)
|
33
|
+
job_data = ActiveSupport::JSON.decode(msg)
|
34
|
+
Base.execute job_data
|
35
|
+
ack!
|
36
|
+
end
|
35
37
|
end
|
36
38
|
end
|
37
39
|
end
|
data/lib/sneakers/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kicks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.
|
4
|
+
version: 3.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dotan Nahum
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-11-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: serverengine
|
@@ -93,28 +93,28 @@ dependencies:
|
|
93
93
|
requirements:
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version: '7.
|
96
|
+
version: '7.2'
|
97
97
|
type: :development
|
98
98
|
prerelease: false
|
99
99
|
version_requirements: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: '7.
|
103
|
+
version: '7.2'
|
104
104
|
- !ruby/object:Gem::Dependency
|
105
105
|
name: activesupport
|
106
106
|
requirement: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - ">="
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: '7.
|
110
|
+
version: '7.2'
|
111
111
|
type: :development
|
112
112
|
prerelease: false
|
113
113
|
version_requirements: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
115
|
- - ">="
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '7.
|
117
|
+
version: '7.2'
|
118
118
|
- !ruby/object:Gem::Dependency
|
119
119
|
name: rabbitmq_http_api_client
|
120
120
|
requirement: !ruby/object:Gem::Requirement
|