resque-picky_worker 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +1 -0
- data/Gemfile.lock +1 -1
- data/readme.md +8 -2
- data/resque-picky_worker.gemspec +2 -2
- metadata +9 -9
data/.gitignore
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
*.gem
|
data/Gemfile.lock
CHANGED
data/readme.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
# Resque::PickyWorker
|
2
2
|
|
3
|
-
Picky worker is a very opinionated worker that will just not be told what work to do. It prefers to pick and choose from the available queues, slotting in where it's needed to help others.
|
3
|
+
Picky worker is a very opinionated worker that will just not be told what work to do. It prefers to pick and choose from the available queues, slotting in where it's needed to help others.
|
4
|
+
|
5
|
+
Combined with a [fork of resque][resque-blocking] that uses a blocking redis command to fetch jobs and exits when there's no more jobs to process on that queue, plus [resque-pool][] to restart dead workers, you end up with a bunch of resque workers that can swarm on queues, work them till they are empty and then move on to other queues. Can also bring other data in from extensions like [resqueue-metadata][] to decide on max number of workers per queue for instance.
|
6
|
+
|
7
|
+
[resque-blocking]: https://github.com/PizzaPowered/resque/tree/blocking_reserve
|
8
|
+
[resqueue-metadata]: https://github.com/PizzaPowered/resqueue-metadata
|
9
|
+
[resque-pool]: https://github.com/nevans/resque-pool
|
4
10
|
|
5
11
|
## Installation
|
6
12
|
|
@@ -14,7 +20,7 @@ Or in your Gemfile
|
|
14
20
|
|
15
21
|
## Usage
|
16
22
|
|
17
|
-
You'll need to require the picky worker, usually with `require "resque/picky_worker/override"` to make it the default Worker class in resque. (Means it
|
23
|
+
You'll need to require the picky worker, usually with `require "resque/picky_worker/override"` to make it the default Worker class in resque. (Means it Just Works™.)
|
18
24
|
|
19
25
|
Then you need to define how you want a queue to be chosen. Lets say we have a bunch of queues named after numbers and we want to choose the highest number available at the time the worker starts:
|
20
26
|
|
data/resque-picky_worker.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "resque-picky_worker"
|
5
|
-
s.version = "0.0.
|
5
|
+
s.version = "0.0.2"
|
6
6
|
s.platform = Gem::Platform::RUBY
|
7
7
|
s.authors = ["Caius Durling"]
|
8
8
|
s.email = ["caius@pizzapowered.com"]
|
@@ -16,6 +16,6 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.require_paths = ["lib"]
|
17
17
|
s.bindir = "bin"
|
18
18
|
|
19
|
-
s.add_dependency "resque"
|
19
|
+
s.add_dependency "resque"
|
20
20
|
s.add_dependency "resqueue-metadata", "~> 0.0.1"
|
21
21
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resque-picky_worker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 2
|
10
|
+
version: 0.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Caius Durling
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-08-
|
18
|
+
date: 2011-08-24 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -24,13 +24,12 @@ dependencies:
|
|
24
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
25
|
none: false
|
26
26
|
requirements:
|
27
|
-
- -
|
27
|
+
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
29
|
+
hash: 3
|
30
30
|
segments:
|
31
|
-
-
|
32
|
-
|
33
|
-
version: "2.2"
|
31
|
+
- 0
|
32
|
+
version: "0"
|
34
33
|
type: :runtime
|
35
34
|
version_requirements: *id001
|
36
35
|
- !ruby/object:Gem::Dependency
|
@@ -59,6 +58,7 @@ extensions: []
|
|
59
58
|
extra_rdoc_files: []
|
60
59
|
|
61
60
|
files:
|
61
|
+
- .gitignore
|
62
62
|
- .rspec
|
63
63
|
- Gemfile
|
64
64
|
- Gemfile.lock
|