request_queue 0.3.0 → 0.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/request_queue/version.rb +1 -1
- data/lib/request_queue.rb +5 -12
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5337d852e069df7e317860a0bbb9718f1c07f577
|
4
|
+
data.tar.gz: add46e260a7ec5d8d49eeb29af49d0df3da7e7e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5001f83b78c4043dd207d8ad23e50852f15f6c38d60fe7871b005a98b7fbd999d8ee74aa3e8bac36f9465bfb225c87b322909d3582bd711e92ddd4848d3437e6
|
7
|
+
data.tar.gz: 901028ba17bb95acb1c3cffc19a1b5555afc2e93d3dbd563622b27823f249fd714211eb3832347f9de652433a6f0a869a76a61188fe93ef7ea5374be53df234d
|
data/lib/request_queue.rb
CHANGED
@@ -4,7 +4,7 @@ require 'request_queue/queue'
|
|
4
4
|
require 'request_queue/inline_queue'
|
5
5
|
require 'request_queue/fake_queue'
|
6
6
|
require 'request_queue/middleware'
|
7
|
-
require '
|
7
|
+
require 'request_queue/railtie' if defined? Rails::Railtie
|
8
8
|
|
9
9
|
module RequestQueue
|
10
10
|
BACKENDS = {
|
@@ -34,18 +34,11 @@ module RequestQueue
|
|
34
34
|
end
|
35
35
|
|
36
36
|
def process(backend = :default)
|
37
|
-
restore do
|
38
|
-
self.queue = BACKENDS.fetch(backend).new
|
39
|
-
yield if block_given?
|
40
|
-
queue.process
|
41
|
-
end
|
42
|
-
end
|
43
|
-
|
44
|
-
private
|
45
|
-
|
46
|
-
def restore
|
47
37
|
original_queue = self.queue
|
48
|
-
|
38
|
+
self.queue = BACKENDS.fetch(backend).new
|
39
|
+
result = yield if block_given?
|
40
|
+
queue.process unless queue.nil?
|
41
|
+
result
|
49
42
|
ensure
|
50
43
|
self.queue = original_queue
|
51
44
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: request_queue
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ray Zane
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: request_store
|