resque-loner 0.1.1 → 0.1.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.
@@ -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. In each queue, there can be at most one UniqueJob with the same parameters.
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 (there were 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 there.
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.
@@ -1,7 +1,7 @@
1
1
  module Resque
2
2
  module Plugins
3
3
  module Loner
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
6
6
  end
7
- end
7
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 1
9
- version: 0.1.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-06-21 00:00:00 +02:00
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: rspec
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: *id001
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
- - 1
82
- - 3
83
- - 5
84
- version: 1.3.5
95
+ - 0
96
+ version: "0"
85
97
  requirements: []
86
98
 
87
99
  rubyforge_project: resque-loner