resque-remote 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +28 -27
- data/README.md +61 -0
- data/lib/resque-remote/version.rb +1 -1
- data/resque-remote.gemspec +10 -6
- metadata +56 -129
data/Gemfile.lock
CHANGED
@@ -1,44 +1,45 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
resque-remote (0.0
|
4
|
+
resque-remote (0.1.0)
|
5
|
+
resque (< 1.18.0)
|
5
6
|
|
6
7
|
GEM
|
7
8
|
remote: http://rubygems.org/
|
8
9
|
specs:
|
9
|
-
diff-lcs (1.1.
|
10
|
-
json (1.4
|
11
|
-
rack (1.
|
12
|
-
|
13
|
-
|
10
|
+
diff-lcs (1.1.3)
|
11
|
+
json (1.5.4)
|
12
|
+
rack (1.4.1)
|
13
|
+
rack-protection (1.2.0)
|
14
|
+
rack
|
15
|
+
redis (2.2.2)
|
16
|
+
redis-namespace (1.0.3)
|
14
17
|
redis (< 3.0.0)
|
15
|
-
resque (1.
|
16
|
-
json (
|
17
|
-
redis-namespace (~> 0.
|
18
|
+
resque (1.17.1)
|
19
|
+
json (>= 1.4.6, < 1.6)
|
20
|
+
redis-namespace (~> 1.0.2)
|
18
21
|
sinatra (>= 0.9.2)
|
19
22
|
vegas (~> 0.1.2)
|
20
|
-
rspec (2.
|
21
|
-
rspec-core (
|
22
|
-
rspec-expectations (
|
23
|
-
rspec-mocks (
|
24
|
-
rspec-core (2.
|
25
|
-
rspec-expectations (2.
|
26
|
-
diff-lcs (
|
27
|
-
rspec-mocks (2.
|
28
|
-
sinatra (1.
|
29
|
-
rack (>= 1.
|
30
|
-
|
23
|
+
rspec (2.8.0)
|
24
|
+
rspec-core (~> 2.8.0)
|
25
|
+
rspec-expectations (~> 2.8.0)
|
26
|
+
rspec-mocks (~> 2.8.0)
|
27
|
+
rspec-core (2.8.0)
|
28
|
+
rspec-expectations (2.8.0)
|
29
|
+
diff-lcs (~> 1.1.2)
|
30
|
+
rspec-mocks (2.8.0)
|
31
|
+
sinatra (1.3.2)
|
32
|
+
rack (~> 1.3, >= 1.3.6)
|
33
|
+
rack-protection (~> 1.2)
|
34
|
+
tilt (~> 1.3, >= 1.3.3)
|
35
|
+
tilt (1.3.3)
|
36
|
+
vegas (0.1.11)
|
31
37
|
rack (>= 1.0.0)
|
32
|
-
yajl-ruby (0.7.7)
|
33
38
|
|
34
39
|
PLATFORMS
|
35
40
|
ruby
|
36
41
|
|
37
42
|
DEPENDENCIES
|
38
|
-
bundler (
|
39
|
-
redis
|
40
|
-
redis-namespace
|
41
|
-
resque (= 1.10.0)
|
43
|
+
bundler (~> 1.0)
|
42
44
|
resque-remote!
|
43
|
-
rspec (
|
44
|
-
yajl-ruby
|
45
|
+
rspec (~> 2.8)
|
data/README.md
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
> **Please note that Resque Remote depends on Resque versions < 1.18.0. resque-remote is not necessary in Resque >= 1.18 as `Resque.enqueue_at` became a standard
|
2
|
+
API method which does exactly what resque-remote aims to provide.**
|
3
|
+
|
4
|
+
Resque Remote is a plugin to allow remote job droppability. Try saying that 10 times fast.
|
5
|
+
|
6
|
+
Resque is great and so is queue-based job processing with redis. Resque Remote aims to provide you the ability to queue a job without having the processing class (e.g. the Job handler itself) loaded into memory.
|
7
|
+
|
8
|
+
Resque Remote's simple goal is to allow you to add a job to a queue with a string identifier for the class rather than the class constant. It is assumed that the worker-side of the equation _will_ have the class in memory and hence will be able to run it no problem. If this isn't the case, the worker will explode in a fiery ball. Probably getting some on you as a result.
|
9
|
+
|
10
|
+
# Installation
|
11
|
+
|
12
|
+
**Note: You must have a version of Resque installed or added to your Gemfile for Resque Remote to work. Resque Version 0.10.0 has been tested to work with the current release of Resque Remote.**
|
13
|
+
|
14
|
+
Install the gem ad-hoc:
|
15
|
+
|
16
|
+
$ gem install resque -v 0.10.0
|
17
|
+
$ gem install resque-remote
|
18
|
+
|
19
|
+
Or, add it to your Bundler `Gemfile`:
|
20
|
+
|
21
|
+
# Gemfile
|
22
|
+
gem 'resque', '0.10.0'
|
23
|
+
gem 'resque-remote'
|
24
|
+
|
25
|
+
And then run a `bundle install`.
|
26
|
+
|
27
|
+
Without Bundler, in your appropriate config location for your app:
|
28
|
+
|
29
|
+
require 'resque'
|
30
|
+
require 'resque-remote'
|
31
|
+
|
32
|
+
If you're using bundler, just setup your gemset normally.
|
33
|
+
|
34
|
+
# Usage
|
35
|
+
|
36
|
+
## (De)Queueing
|
37
|
+
To queue a job, tell resque to `remote_enqueue` your job by passing the string representation of your job's class name, the name of the queue to use, and whatever parameters are appropriate for the job.
|
38
|
+
|
39
|
+
Resque.remote_enqueue('MyJobClass', :low_priority, param1, param2, ...)
|
40
|
+
|
41
|
+
To dequeue, call `remote_dequeue` instead:
|
42
|
+
|
43
|
+
Resque.remote_dequeue('MyJobClass', :low_priority, param1, param2, ...)
|
44
|
+
|
45
|
+
## Worker processing
|
46
|
+
|
47
|
+
Resque Remotes purpose is to make remote job processing doable. Hence, your workers won't be running the same application code that actually queued the job for you in the first place. So, assuming I queued the jobs from above, your separate application should have an implementing class that your workers have access to.
|
48
|
+
|
49
|
+
Note that the queue this job belongs to isn't defined in our job class because it's metadata that Resque uses when it first queues the job, which we've already done. So, no `@queue = :low_priority` needed here.
|
50
|
+
|
51
|
+
class MyJobClass
|
52
|
+
# no queue needed
|
53
|
+
|
54
|
+
def self.perform(param1, param2)
|
55
|
+
# ... process the job herre
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# Errata
|
60
|
+
|
61
|
+
Feedback, comments and questions are welcome at bj [dot] neilsen [at] gmail [dot] com.
|
data/resque-remote.gemspec
CHANGED
@@ -10,6 +10,9 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.homepage = 'http://github.com/localshred/resque-remote'
|
11
11
|
s.summary = 'Resque plugin to allow remote job droppability'
|
12
12
|
s.description = %Q{
|
13
|
+
Note: Resque-remote is not needed in resque >= 0.18 as `enqueue_at` became a standard
|
14
|
+
API method which does exactly what resque-remote aims to provide.
|
15
|
+
|
13
16
|
Resque is great. So is job processing with redis. Our biggest drawback has been that
|
14
17
|
resque requires the class that will be processing a job to be loaded when the job
|
15
18
|
is enqueued. But what happens when the implementing job is defined in a separate application
|
@@ -27,12 +30,13 @@ Feedback, comments and questions are welcome at bj [dot] neilsen [at] gmail [dot
|
|
27
30
|
s.required_rubygems_version = '>= 1.3.6'
|
28
31
|
s.rubyforge_project = 'resque-remote'
|
29
32
|
|
30
|
-
s.
|
31
|
-
|
32
|
-
s.add_development_dependency '
|
33
|
-
s.add_development_dependency '
|
34
|
-
s.add_development_dependency 'redis
|
35
|
-
s.add_development_dependency '
|
33
|
+
s.add_dependency 'resque', '< 1.18.0'
|
34
|
+
|
35
|
+
s.add_development_dependency 'bundler', '~> 1.0'
|
36
|
+
s.add_development_dependency 'rspec', '~> 2.8'
|
37
|
+
# s.add_development_dependency 'redis'
|
38
|
+
# s.add_development_dependency 'redis-namespace'
|
39
|
+
# s.add_development_dependency 'yajl-ruby'
|
36
40
|
|
37
41
|
s.files = `git ls-files`.split("\n")
|
38
42
|
s.require_path = 'lib'
|
metadata
CHANGED
@@ -1,132 +1,69 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: resque-remote
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 0
|
8
|
-
- 1
|
9
|
-
version: 0.0.1
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- BJ Neilsen
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
21
|
-
name: bundler
|
22
|
-
prerelease: false
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
-
none: false
|
25
|
-
requirements:
|
26
|
-
- - "="
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
segments:
|
29
|
-
- 1
|
30
|
-
- 0
|
31
|
-
- 0
|
32
|
-
- rc
|
33
|
-
- 6
|
34
|
-
version: 1.0.0.rc.6
|
35
|
-
type: :development
|
36
|
-
version_requirements: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: rspec
|
39
|
-
prerelease: false
|
40
|
-
requirement: &id002 !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
|
-
requirements:
|
43
|
-
- - "="
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
segments:
|
46
|
-
- 2
|
47
|
-
- 0
|
48
|
-
- 0
|
49
|
-
- beta
|
50
|
-
- 20
|
51
|
-
version: 2.0.0.beta.20
|
52
|
-
type: :development
|
53
|
-
version_requirements: *id002
|
54
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-02-06 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
55
15
|
name: resque
|
56
|
-
|
57
|
-
requirement: &id003 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &2153289880 !ruby/object:Gem::Requirement
|
58
17
|
none: false
|
59
|
-
requirements:
|
60
|
-
- -
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
|
63
|
-
|
64
|
-
- 10
|
65
|
-
- 0
|
66
|
-
version: 1.10.0
|
67
|
-
type: :development
|
68
|
-
version_requirements: *id003
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: redis
|
18
|
+
requirements:
|
19
|
+
- - <
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 1.18.0
|
22
|
+
type: :runtime
|
71
23
|
prerelease: false
|
72
|
-
|
24
|
+
version_requirements: *2153289880
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: bundler
|
27
|
+
requirement: &2153288740 !ruby/object:Gem::Requirement
|
73
28
|
none: false
|
74
|
-
requirements:
|
75
|
-
- -
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
|
78
|
-
- 0
|
79
|
-
version: "0"
|
29
|
+
requirements:
|
30
|
+
- - ~>
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '1.0'
|
80
33
|
type: :development
|
81
|
-
version_requirements: *id004
|
82
|
-
- !ruby/object:Gem::Dependency
|
83
|
-
name: redis-namespace
|
84
34
|
prerelease: false
|
85
|
-
|
35
|
+
version_requirements: *2153288740
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rspec
|
38
|
+
requirement: &2153287300 !ruby/object:Gem::Requirement
|
86
39
|
none: false
|
87
|
-
requirements:
|
88
|
-
- -
|
89
|
-
- !ruby/object:Gem::Version
|
90
|
-
|
91
|
-
- 0
|
92
|
-
version: "0"
|
40
|
+
requirements:
|
41
|
+
- - ~>
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '2.8'
|
93
44
|
type: :development
|
94
|
-
version_requirements: *id005
|
95
|
-
- !ruby/object:Gem::Dependency
|
96
|
-
name: yajl-ruby
|
97
45
|
prerelease: false
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
resque requires the class that will be processing a job to be loaded when the job \n\
|
111
|
-
is enqueued. But what happens when the implementing job is defined in a separate application\n\
|
112
|
-
and isn't currently loaded into memory?\n\n\
|
113
|
-
Enter Resque Remote.\n\n\
|
114
|
-
Resque Remote's simple goal is to allow you to add a job to a queue with a string\n\
|
115
|
-
identifier for the class rather than the class constant. It is assumed that the worker-side of\n\
|
116
|
-
the equation _will_ have the class in memory and hence will be able to run it no problem.\n\n\
|
117
|
-
Feedback, comments and questions are welcome at bj [dot] neilsen [at] gmail [dot] com.\n"
|
118
|
-
email:
|
46
|
+
version_requirements: *2153287300
|
47
|
+
description: ! "\nNote: Resque-remote is not needed in resque >= 0.18 as `enqueue_at`
|
48
|
+
became a standard\nAPI method which does exactly what resque-remote aims to provide.\n\nResque
|
49
|
+
is great. So is job processing with redis. Our biggest drawback has been that\nresque
|
50
|
+
requires the class that will be processing a job to be loaded when the job \nis
|
51
|
+
enqueued. But what happens when the implementing job is defined in a separate application\nand
|
52
|
+
isn't currently loaded into memory?\n\nEnter Resque Remote.\n\nResque Remote's simple
|
53
|
+
goal is to allow you to add a job to a queue with a string\nidentifier for the class
|
54
|
+
rather than the class constant. It is assumed that the worker-side of\nthe equation
|
55
|
+
_will_ have the class in memory and hence will be able to run it no problem.\n\nFeedback,
|
56
|
+
comments and questions are welcome at bj [dot] neilsen [at] gmail [dot] com.\n"
|
57
|
+
email:
|
119
58
|
- bj.neilsen@gmail.com
|
120
59
|
executables: []
|
121
|
-
|
122
60
|
extensions: []
|
123
|
-
|
124
61
|
extra_rdoc_files: []
|
125
|
-
|
126
|
-
files:
|
62
|
+
files:
|
127
63
|
- .gitignore
|
128
64
|
- Gemfile
|
129
65
|
- Gemfile.lock
|
66
|
+
- README.md
|
130
67
|
- Rakefile
|
131
68
|
- lib/resque-remote.rb
|
132
69
|
- lib/resque-remote/remote.rb
|
@@ -134,39 +71,29 @@ files:
|
|
134
71
|
- resque-remote.gemspec
|
135
72
|
- spec/remote_spec.rb
|
136
73
|
- spec/spec_helper.rb
|
137
|
-
has_rdoc: true
|
138
74
|
homepage: http://github.com/localshred/resque-remote
|
139
75
|
licenses: []
|
140
|
-
|
141
76
|
post_install_message:
|
142
77
|
rdoc_options: []
|
143
|
-
|
144
|
-
require_paths:
|
78
|
+
require_paths:
|
145
79
|
- lib
|
146
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
80
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
147
81
|
none: false
|
148
|
-
requirements:
|
149
|
-
- -
|
150
|
-
- !ruby/object:Gem::Version
|
151
|
-
|
152
|
-
|
153
|
-
version: "0"
|
154
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
155
87
|
none: false
|
156
|
-
requirements:
|
157
|
-
- -
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
segments:
|
160
|
-
- 1
|
161
|
-
- 3
|
162
|
-
- 6
|
88
|
+
requirements:
|
89
|
+
- - ! '>='
|
90
|
+
- !ruby/object:Gem::Version
|
163
91
|
version: 1.3.6
|
164
92
|
requirements: []
|
165
|
-
|
166
93
|
rubyforge_project: resque-remote
|
167
|
-
rubygems_version: 1.
|
94
|
+
rubygems_version: 1.8.10
|
168
95
|
signing_key:
|
169
96
|
specification_version: 3
|
170
97
|
summary: Resque plugin to allow remote job droppability
|
171
98
|
test_files: []
|
172
|
-
|
99
|
+
has_rdoc:
|