background_worker 0.6.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/background_worker/base.rb +5 -0
- data/lib/background_worker/version.rb +1 -1
- data/spec/base_spec.rb +7 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37f371795b57bf7461a9f02c9f74195daf9d3cb61328fd0eca5f69a2c61447b6
|
4
|
+
data.tar.gz: 393896f93efac8a56c0806a8664ea381fff12ff31a2e0e31c210d6a3480694b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dae022eecbd54ce73185739df605b3fa5ffd1efc12e411d86bd76f6bfac03f4e20616ac20ffdda04d7c3ef3c3d3d403dac69754a45b5ca9d6fb57daab2444acc
|
7
|
+
data.tar.gz: 0f9f04c606150a637744facdc4c9d9bb02ff1918d52b24fd92f5ebb47ec3606aab2e59567355422b485924352cc471f29e18d4be6438378e3ead11e0aeff3c96
|
data/CHANGELOG.md
CHANGED
@@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
|
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
4
|
This changelog adheres to [Keep a CHANGELOG](http://keepachangelog.com/).
|
5
5
|
|
6
|
+
## 0.7.0
|
7
|
+
|
8
|
+
- [PLAT-670] Add queue_as method
|
9
|
+
|
6
10
|
## 0.6.0
|
7
11
|
|
8
12
|
- [PLAT-664] Align interface to ActiveJob
|
@@ -53,6 +53,7 @@ module BackgroundWorker
|
|
53
53
|
end
|
54
54
|
|
55
55
|
class << self
|
56
|
+
attr_reader :queue
|
56
57
|
def get_state_of(worker_id)
|
57
58
|
BackgroundWorker::PersistentState.get_state_of(worker_id)
|
58
59
|
end
|
@@ -85,6 +86,10 @@ module BackgroundWorker
|
|
85
86
|
ensure
|
86
87
|
BackgroundWorker.release_connections! if BackgroundWorker.config.backgrounded
|
87
88
|
end
|
89
|
+
|
90
|
+
def queue_as(queue = nil)
|
91
|
+
@queue = queue&.to_sym || :default
|
92
|
+
end
|
88
93
|
end
|
89
94
|
end
|
90
95
|
end
|
data/spec/base_spec.rb
CHANGED
@@ -36,4 +36,11 @@ describe BackgroundWorker::Base do
|
|
36
36
|
end
|
37
37
|
expect(cache).to have_received(:store).with(42)
|
38
38
|
end
|
39
|
+
|
40
|
+
context '#queue_as' do
|
41
|
+
it 'should value queue correctly' do
|
42
|
+
worker_class.queue_as('low')
|
43
|
+
expect(worker_class.queue).to be :low
|
44
|
+
end
|
45
|
+
end
|
39
46
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: background_worker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Noack
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2022-09-
|
13
|
+
date: 2022-09-07 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|