resque-remote 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +9 -9
- data/README.md +8 -11
- data/lib/resque-remote/version.rb +1 -1
- data/resque-remote.gemspec +3 -9
- metadata +40 -21
data/Gemfile.lock
CHANGED
@@ -1,23 +1,23 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
resque-remote (0.1.
|
5
|
-
resque (
|
4
|
+
resque-remote (0.1.1)
|
5
|
+
resque (~> 1.0)
|
6
6
|
|
7
7
|
GEM
|
8
8
|
remote: http://rubygems.org/
|
9
9
|
specs:
|
10
10
|
diff-lcs (1.1.3)
|
11
|
-
|
11
|
+
multi_json (1.3.6)
|
12
12
|
rack (1.4.1)
|
13
13
|
rack-protection (1.2.0)
|
14
14
|
rack
|
15
|
-
redis (
|
16
|
-
redis-namespace (1.0
|
17
|
-
redis (
|
18
|
-
resque (1.
|
19
|
-
|
20
|
-
redis-namespace (~> 1.0
|
15
|
+
redis (3.0.1)
|
16
|
+
redis-namespace (1.2.0)
|
17
|
+
redis (~> 3.0.0)
|
18
|
+
resque (1.21.0)
|
19
|
+
multi_json (~> 1.0)
|
20
|
+
redis-namespace (~> 1.0)
|
21
21
|
sinatra (>= 0.9.2)
|
22
22
|
vegas (~> 0.1.2)
|
23
23
|
rspec (2.8.0)
|
data/README.md
CHANGED
@@ -1,9 +1,6 @@
|
|
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
1
|
Resque Remote is a plugin to allow remote job droppability. Try saying that 10 times fast.
|
5
2
|
|
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.
|
3
|
+
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
4
|
|
8
5
|
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
6
|
|
@@ -15,20 +12,20 @@ Install the gem ad-hoc:
|
|
15
12
|
|
16
13
|
$ gem install resque -v 0.10.0
|
17
14
|
$ gem install resque-remote
|
18
|
-
|
15
|
+
|
19
16
|
Or, add it to your Bundler `Gemfile`:
|
20
17
|
|
21
18
|
# Gemfile
|
22
19
|
gem 'resque', '0.10.0'
|
23
20
|
gem 'resque-remote'
|
24
|
-
|
21
|
+
|
25
22
|
And then run a `bundle install`.
|
26
|
-
|
23
|
+
|
27
24
|
Without Bundler, in your appropriate config location for your app:
|
28
25
|
|
29
26
|
require 'resque'
|
30
27
|
require 'resque-remote'
|
31
|
-
|
28
|
+
|
32
29
|
If you're using bundler, just setup your gemset normally.
|
33
30
|
|
34
31
|
# Usage
|
@@ -37,11 +34,11 @@ If you're using bundler, just setup your gemset normally.
|
|
37
34
|
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
35
|
|
39
36
|
Resque.remote_enqueue('MyJobClass', :low_priority, param1, param2, ...)
|
40
|
-
|
37
|
+
|
41
38
|
To dequeue, call `remote_dequeue` instead:
|
42
39
|
|
43
40
|
Resque.remote_dequeue('MyJobClass', :low_priority, param1, param2, ...)
|
44
|
-
|
41
|
+
|
45
42
|
## Worker processing
|
46
43
|
|
47
44
|
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.
|
@@ -50,7 +47,7 @@ Note that the queue this job belongs to isn't defined in our job class because i
|
|
50
47
|
|
51
48
|
class MyJobClass
|
52
49
|
# no queue needed
|
53
|
-
|
50
|
+
|
54
51
|
def self.perform(param1, param2)
|
55
52
|
# ... process the job herre
|
56
53
|
end
|
data/resque-remote.gemspec
CHANGED
@@ -10,11 +10,8 @@ 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
|
-
|
16
13
|
Resque is great. So is job processing with redis. Our biggest drawback has been that
|
17
|
-
resque requires the class that will be processing a job to be loaded when the job
|
14
|
+
resque requires the class that will be processing a job to be loaded when the job
|
18
15
|
is enqueued. But what happens when the implementing job is defined in a separate application
|
19
16
|
and isn't currently loaded into memory?
|
20
17
|
|
@@ -30,13 +27,10 @@ Feedback, comments and questions are welcome at bj [dot] neilsen [at] gmail [dot
|
|
30
27
|
s.required_rubygems_version = '>= 1.3.6'
|
31
28
|
s.rubyforge_project = 'resque-remote'
|
32
29
|
|
33
|
-
s.add_dependency 'resque', '
|
34
|
-
|
30
|
+
s.add_dependency 'resque', '~> 1.0'
|
31
|
+
|
35
32
|
s.add_development_dependency 'bundler', '~> 1.0'
|
36
33
|
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'
|
40
34
|
|
41
35
|
s.files = `git ls-files`.split("\n")
|
42
36
|
s.require_path = 'lib'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: resque-remote
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,22 +9,22 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-07-27 00:00:00.000000000Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: resque
|
16
|
-
requirement: &
|
16
|
+
requirement: &2156201460 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
|
-
- -
|
19
|
+
- - ~>
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.
|
21
|
+
version: '1.0'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *2156201460
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: bundler
|
27
|
-
requirement: &
|
27
|
+
requirement: &2156200900 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: '1.0'
|
33
33
|
type: :development
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *2156200900
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rspec
|
38
|
-
requirement: &
|
38
|
+
requirement: &2156200440 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,17 +43,36 @@ dependencies:
|
|
43
43
|
version: '2.8'
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
47
|
-
description: !
|
48
|
-
|
49
|
-
is great. So is job processing with redis. Our biggest drawback has been
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
46
|
+
version_requirements: *2156200440
|
47
|
+
description: ! '
|
48
|
+
|
49
|
+
Resque is great. So is job processing with redis. Our biggest drawback has been
|
50
|
+
that
|
51
|
+
|
52
|
+
resque requires the class that will be processing a job to be loaded when the job
|
53
|
+
|
54
|
+
is enqueued. But what happens when the implementing job is defined in a separate
|
55
|
+
application
|
56
|
+
|
57
|
+
and isn''t currently loaded into memory?
|
58
|
+
|
59
|
+
|
60
|
+
Enter Resque Remote.
|
61
|
+
|
62
|
+
|
63
|
+
Resque Remote''s simple goal is to allow you to add a job to a queue with a string
|
64
|
+
|
65
|
+
identifier for the class rather than the class constant. It is assumed that the
|
66
|
+
worker-side of
|
67
|
+
|
68
|
+
the equation _will_ have the class in memory and hence will be able to run it no
|
69
|
+
problem.
|
70
|
+
|
71
|
+
|
72
|
+
Feedback, comments and questions are welcome at bj [dot] neilsen [at] gmail [dot]
|
73
|
+
com.
|
74
|
+
|
75
|
+
'
|
57
76
|
email:
|
58
77
|
- bj.neilsen@gmail.com
|
59
78
|
executables: []
|
@@ -91,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
91
110
|
version: 1.3.6
|
92
111
|
requirements: []
|
93
112
|
rubyforge_project: resque-remote
|
94
|
-
rubygems_version: 1.8.
|
113
|
+
rubygems_version: 1.8.15
|
95
114
|
signing_key:
|
96
115
|
specification_version: 3
|
97
116
|
summary: Resque plugin to allow remote job droppability
|