em-resque 1.0.0.beta4 → 1.0.0.beta5

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.
data/README.markdown CHANGED
@@ -198,8 +198,8 @@ resque_config = YAML.load_file("#{RAILS_ROOT}/config/resque.yml")
198
198
  proxy_config = YAML.load_file("#{RAILS_ROOT}/config/proxy.yml")
199
199
  PROXY = proxy_config ? proxy_config[RAILS_ENV] : nil
200
200
 
201
- EM::Resque.redis = resque_config[RAILS_ENV]
202
- EM::Resque::WorkerMachine.new(TaskHelper.parse_opts_from_env).start
201
+ opts = TaskHelper.parse_opts_from_env.merge(:redis => resque_config[RAILS_ENV])
202
+ EM::Resque::WorkerMachine.new(opts).start
203
203
  ```
204
204
 
205
205
  You can start the script with the same environment variables as with the Rake
@@ -216,16 +216,16 @@ Configuration
216
216
  You may want to change the Redis host and port Resque connects to, or
217
217
  set various other options at startup.
218
218
 
219
- EM::Resque has a `redis` setter which can be given a string or a Redis
220
- object. This means if you're already using Redis in your app, EM::Resque
221
- can re-use the existing connection. EM::Resque is using the non-blocking
222
- em-redis by default.
219
+ WorkerMachine has a `redis` parameter in the initializer, which can be
220
+ given a string or a Redis object. This means if you're already using
221
+ Redis in your app, EM::Resquec an re-use the existing connection.
222
+ EM::Resque is using the non-blocking em-redis when given the host as a
223
+ string. If using a Redis object, please use the non-blocking
224
+ EM::Protocols::Redis.
223
225
 
224
- String: `Resque.redis = 'localhost:6379'`
226
+ String: `EM::Resque::WorkerMachine.new(opts.merge(:redis => 'localhost:6379'))`
225
227
 
226
- Redis: `Resque.redis = $redis`
227
-
228
- TODO: Better configuration instructions.
228
+ Redis: `EM::Resque::WorkerMachine.new(opts.merge(:redis => $redis))`
229
229
 
230
230
  Namespaces
231
231
  ----------
@@ -1,5 +1,5 @@
1
1
  module EventMachine
2
2
  module Resque
3
- Version = VERSION = '1.0.0.beta4'
3
+ Version = VERSION = '1.0.0.beta5'
4
4
  end
5
5
  end
@@ -39,8 +39,6 @@ module EventMachine
39
39
 
40
40
  build_workers
41
41
  build_fibers
42
- trap_signals
43
- prune_dead_workers
44
42
  create_pidfile
45
43
  end
46
44
 
@@ -48,6 +46,8 @@ module EventMachine
48
46
  def start
49
47
  EM.synchrony do
50
48
  EM::Resque.redis = redis_instance(@redis)
49
+ prune_dead_workers
50
+ trap_signals
51
51
  @fibers.each(&:resume)
52
52
  system_monitor.resume
53
53
  end
@@ -114,7 +114,7 @@ module EventMachine
114
114
  end
115
115
 
116
116
  def create_pidfile
117
- File.open(@pidfile, 'w') { |f| f << @workers.first.pid } if @pidfile
117
+ File.open(@pidfile, 'w') { |f| f << Process.pid } if @pidfile
118
118
  end
119
119
 
120
120
  def redis_instance(server)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: em-resque
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta4
4
+ version: 1.0.0.beta5
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-12 00:00:00.000000000 Z
12
+ date: 2012-01-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: resque
16
- requirement: &19367640 !ruby/object:Gem::Requirement
16
+ requirement: &18876140 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 1.19.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *19367640
24
+ version_requirements: *18876140
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: em-synchrony
27
- requirement: &19366960 !ruby/object:Gem::Requirement
27
+ requirement: &18875480 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: 1.0.0
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *19366960
35
+ version_requirements: *18875480
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: em-redis
38
- requirement: &19366480 !ruby/object:Gem::Requirement
38
+ requirement: &18874980 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *19366480
46
+ version_requirements: *18874980
47
47
  description: ! " Em-resque is a version of Resque, which offers non-blocking and
48
48
  non-forking\n workers. The idea is to have fast as possible workers for tasks
49
49
  with lots of\n IO like pinging third party servers or hitting the database.\n\n