trinidad_threaded_resque_extension 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -16,11 +16,16 @@ And then execute:
16
16
 
17
17
  Then configure it via config/trinidad.rb:
18
18
 
19
- require 'bundler/setup'
20
- Trinidad.configure |config|
21
- config.jruby_max_runtimes = 1
22
- ...
23
- config.extensions = {
19
+ ```ruby
20
+ require 'bundler/setup'
21
+ Trinidad.configure do |config|
22
+ config.jruby_min_runtimes = 1
23
+ config.jruby_max_runtimes = 1
24
+ ...
25
+ config.web_apps = {
26
+ default = {
27
+ rackup: 'config.ru'
28
+ extensions = {
24
29
  threaded_resque: {
25
30
  require: './config/setup_resque_workers', # will be required before starting the workers, setup Resque and require the jobs here
26
31
  queues: {
@@ -32,6 +37,10 @@ Then configure it via config/trinidad.rb:
32
37
  }
33
38
  }
34
39
  }
40
+ }
41
+ }
42
+ end
43
+ ```
35
44
 
36
45
  ## Usage
37
46
 
@@ -5,9 +5,9 @@ require_relative "trinidad_threaded_resque_extension/lifecycle_listener"
5
5
 
6
6
  module Trinidad
7
7
  module Extensions
8
- class ThreadedResqueServerExtension < ServerExtension
9
- def configure(tomcat)
10
- tomcat.host.add_lifecycle_listener(ThreadedResque::LifecycleListener.new(@options))
8
+ class ThreadedResqueWebAppExtension < WebAppExtension
9
+ def configure(tomcat, app_context)
10
+ app_context.add_lifecycle_listener(ThreadedResque::LifecycleListener.new(@options))
11
11
  end
12
12
  end
13
13
  end
@@ -13,7 +13,7 @@ module Trinidad
13
13
 
14
14
  def lifecycleEvent(event)
15
15
  case event.type
16
- when Trinidad::Tomcat::Lifecycle::BEFORE_START_EVENT
16
+ when Trinidad::Tomcat::Lifecycle::AFTER_START_EVENT
17
17
  start_workers
18
18
  when Trinidad::Tomcat::Lifecycle::BEFORE_STOP_EVENT
19
19
  stop_workers
@@ -1,3 +1,3 @@
1
1
  module TrinidadThreadedResqueExtension
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: trinidad_threaded_resque_extension
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.0
5
+ version: 0.2.0
6
6
  platform: ruby
7
7
  authors:
8
8
  - Carl Hörberg
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-28 00:00:00.000000000Z
12
+ date: 2012-04-03 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  none: false
106
106
  requirements: []
107
107
  rubyforge_project:
108
- rubygems_version: 1.8.15
108
+ rubygems_version: 1.8.17
109
109
  signing_key:
110
110
  specification_version: 3
111
111
  summary: Runs Resque workers, threaded, within the Trinidad application server