resque-roulette 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 +14 -2
- data/lib/resque/plugins/roulette/version.rb +1 -1
- data/lib/resque/plugins/roulette.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b31b767a11732dd11f0eeb044f8d1ad5be28120066bf9347e6feb85bb48054d
|
4
|
+
data.tar.gz: f8103a79ec6b33fdc8967d30d173a78880d113ecc41d3e961ad8cfe0728f7ca5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 214fe6a2773d242cb90467ae78bb7cb9f0f6a5b611fcb5b9f86ef9e6c148c904f9a1a0c1a1ce0a77b6085739914105d711273d437009d2036278c9d1df551925
|
7
|
+
data.tar.gz: ffa1a4e357f64d87884cae11a96ccad002a8c03241b86e4b54466af9a0a3ff79767af139fe08924a03696f7cb2049457ff31d7cb9029b4601fcafa3dd1348c34
|
data/README.md
CHANGED
@@ -14,6 +14,13 @@ so on). This plugin randomizes the order of the queues based on weights, so that
|
|
14
14
|
weights 4, 3, 2, 1, repsectively, A will be first 40% of the time, B 30%, C 20%, and D 10%. In addition, when B is first, A will be second 4/7ths of the time (4 / [4+2+1]), and so on. The
|
15
15
|
project is inspired by [resque-fairly](https://github.com/pezra/resque-fairly) by Peter Williams, which unfortunately mathematically does not give you this control over the weights.
|
16
16
|
|
17
|
+
### Install
|
18
|
+
|
19
|
+
```rb
|
20
|
+
# gem 'resque'
|
21
|
+
gem 'resque-roulette'
|
22
|
+
```
|
23
|
+
|
17
24
|
### Example usage
|
18
25
|
|
19
26
|
``` ruby
|
@@ -28,8 +35,13 @@ Resque::Plugins::Roulette.prioritize('someotherqueue', 6)
|
|
28
35
|
Now, workers processing all three queues will (assuming all queues have jobs) take jobs from someotherqueue 60% of the time, myotherqueue 30% of the time, and myqueue 10% of the time. This is achieved
|
29
36
|
by reordering the queues, so if someotherqueue is empty, the workers will take jobs from myotherqueue 75% (3/4) of the time.
|
30
37
|
|
38
|
+
### Publish
|
39
|
+
|
40
|
+
- `rake build`
|
41
|
+
- `rake release`
|
42
|
+
- `gem push pkg/resque-roulette-<version>.gem`
|
31
43
|
|
32
44
|
### Authors
|
33
45
|
|
34
|
-
- **Mantainer** - Bruno Casali @brunoocasali
|
35
|
-
- **Creator** - Evan Battaglia @evanbattaglia
|
46
|
+
- **Mantainer** - Bruno Casali [@brunoocasali](https://github.com/brunoocasali)
|
47
|
+
- **Creator** - Evan Battaglia [@evanbattaglia](https://github.com/evanbattaglia)
|
@@ -32,8 +32,8 @@ module Resque::Plugins
|
|
32
32
|
|
33
33
|
def self.included(klass)
|
34
34
|
klass.instance_eval do
|
35
|
-
|
36
|
-
|
35
|
+
alias_method :queues_orig_ordered, :queues
|
36
|
+
alias_method :queues, :queues_randomly_ordered
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|