sidekiq-running 0.0.1 → 0.0.2
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/README.md +3 -0
- data/lib/sidekiq/running.rb +12 -0
- data/lib/sidekiq/running/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a849f1752910eba28b10c12cbd0e112cbd35aae0
|
4
|
+
data.tar.gz: 97a727756281b834260e142a94e476972a171030
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbe8831b8c9dace44f767940bb89deb718d8b05f5e151a111ab821f6c5abdf72bb703f4b06db361fc462a0136679420ff431a3a3268d4b2ee3eba4aa8655338e
|
7
|
+
data.tar.gz: b680a15a5a295c1cfd0d96cb8bae31e78ad81963cd32e17622ab54ed9f3f4b3cdb8a93e2af30115e89521dc45c49e09927aea85ffce2a4f6ef9a7f529c7d2fc2
|
data/README.md
CHANGED
@@ -38,6 +38,9 @@ HardWorker.queued?("buy dr.pepper", 10) # => true
|
|
38
38
|
- queued?(*args)
|
39
39
|
- running?(*args)
|
40
40
|
- queued_or_running?(*args)
|
41
|
+
- perform_async_unless_queued(*args)
|
42
|
+
- perform_async_unless_running(*args)
|
43
|
+
- perform_async_unless_queued_or_running(*args)
|
41
44
|
- queue_name
|
42
45
|
|
43
46
|
## Contributing
|
data/lib/sidekiq/running.rb
CHANGED
@@ -30,6 +30,18 @@ module Sidekiq
|
|
30
30
|
def queued_or_running?(*args)
|
31
31
|
running?(*args) or queued?(*args)
|
32
32
|
end
|
33
|
+
|
34
|
+
def perform_async_unless_queued(*args)
|
35
|
+
perform_async(*args) unless queued?(*args)
|
36
|
+
end
|
37
|
+
|
38
|
+
def perform_async_unless_running(*args)
|
39
|
+
perform_async(*args) unless running?(*args)
|
40
|
+
end
|
41
|
+
|
42
|
+
def perform_async_unless_queued_or_running(*args)
|
43
|
+
perform_async(*args) unless queued_or_running?(*args)
|
44
|
+
end
|
33
45
|
end
|
34
46
|
end
|
35
47
|
end
|