resque-loner 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +10 -2
- data/lib/resque-loner/version.rb +2 -2
- metadata +21 -9
data/README.markdown
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
Resque-Loner
|
3
3
|
======
|
4
4
|
|
5
|
-
Resque-Loner is a plugin for defunkt/resque which adds unique jobs to resque
|
5
|
+
Resque-Loner is a plugin for defunkt/resque which adds unique jobs to resque: Only one job with the same payload per queue.
|
6
6
|
|
7
7
|
|
8
8
|
Installation
|
@@ -60,6 +60,14 @@ Since resque-loner keeps track of which jobs are queued in a way that allows for
|
|
60
60
|
=> true
|
61
61
|
>> Resque.enqueued? CacheSweeper, 2
|
62
62
|
=> false
|
63
|
+
>> Resque.enqueued_in? :another_queue, CacheSweeper, 1
|
64
|
+
=> false
|
65
|
+
|
66
|
+
If you want the same type of job in different queues, resque-loner lets you enqueue/dequeue to a queue of your choice:
|
67
|
+
|
68
|
+
>> Resque.enqueue_to :another_queue, CacheSweeper, 1
|
69
|
+
=> "OK"
|
70
|
+
>> Resqueue.dequeue_from :another_queue, CacheSweeper, 1
|
63
71
|
|
64
72
|
How it works
|
65
73
|
--------
|
@@ -93,4 +101,4 @@ So when your job overwrites the #redis_key method, make sure these requirements
|
|
93
101
|
|
94
102
|
### Resque integration
|
95
103
|
|
96
|
-
Unfortunately not everything could be done as a plugin, so I overwrote three methods of Resque::Job: create, reserve and destroy (
|
104
|
+
Unfortunately not everything could be done as a plugin, so I overwrote three methods of Resque::Job: create, reserve and destroy (I found no hooks for these events). All the logic is in `module Resque::Plugins::Loner` though, so it should be fairly easy to make this a *pure* plugin once the hooks are known.
|
data/lib/resque-loner/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 2
|
9
|
+
version: 0.1.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Jannis Hermanns
|
@@ -14,13 +14,27 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-08-03 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
|
-
name:
|
21
|
+
name: resque
|
22
22
|
prerelease: false
|
23
23
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 1
|
29
|
+
- 9
|
30
|
+
- 5
|
31
|
+
version: 1.9.5
|
32
|
+
type: :runtime
|
33
|
+
version_requirements: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: rspec
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
24
38
|
requirements:
|
25
39
|
- - ">="
|
26
40
|
- !ruby/object:Gem::Version
|
@@ -28,7 +42,7 @@ dependencies:
|
|
28
42
|
- 0
|
29
43
|
version: "0"
|
30
44
|
type: :development
|
31
|
-
version_requirements: *
|
45
|
+
version_requirements: *id002
|
32
46
|
description: |
|
33
47
|
Makes sure that for special jobs, there can be only one job with the same workload in one queue.
|
34
48
|
|
@@ -78,10 +92,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
78
92
|
- - ">="
|
79
93
|
- !ruby/object:Gem::Version
|
80
94
|
segments:
|
81
|
-
-
|
82
|
-
|
83
|
-
- 5
|
84
|
-
version: 1.3.5
|
95
|
+
- 0
|
96
|
+
version: "0"
|
85
97
|
requirements: []
|
86
98
|
|
87
99
|
rubyforge_project: resque-loner
|