torquebox-sidekiq-service 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ language: ruby
2
+ rvm:
3
+ - jruby-19mode
4
+ - jruby-head
5
+ env:
6
+ - JAVA_OPTS="-server -Djruby.cext.enabled=false -Djruby.compile.invokedynamic=false"
7
+
data/ChangeLog.md ADDED
@@ -0,0 +1,11 @@
1
+ 0.1.1 (03/28/2013)
2
+ ------------------
3
+
4
+ * Don't silently swallow errors during Sidekiq launcher startup.
5
+ * Properly handle `stop` calls on the service when Sidekiq failed to launch.
6
+ * Properly handle `stop` calls on the service if Sidekiq has finished launching (fixed a race condition).
7
+
8
+ 0.1.0 (03/13/2013)
9
+ ------------------
10
+
11
+ * Initial release.
data/NOTICE ADDED
@@ -0,0 +1,2 @@
1
+ Mogotest Jenkins Plugin
2
+ Copyright 2013 Mogoterra, Inc.
data/README.md CHANGED
@@ -4,6 +4,8 @@ TorqueBox Sidekiq Service
4
4
  This library provides a TorqueBox service for running Sidekiq inside the TorqueBox application server. It replaces the
5
5
  Sidekiq CLI client typically used to start up TorqueBox.
6
6
 
7
+ [![Build Status](https://secure.travis-ci.org/mogotest/torquebox-sidekiq-service.png)](http://travis-ci.org/mogotest/torquebox-sidekiq-service)
8
+
7
9
  Rationale
8
10
  ---------
9
11
 
@@ -21,6 +23,7 @@ There are several other reasons why a TorqueBox service may make sense for you:
21
23
  ** No need for foreman or similar tools in development
22
24
  * Easier to debug & profile by way of TorqueBox's debugging and profiling capabilities
23
25
  * Better opportunity for JVM JIT optimization
26
+ * Faster deploys, as you don't have to wait for the Sidekiq CLI client to start and stop
24
27
 
25
28
  Of course, for every item that I think is a pro, someone else may think is a con. Depending on perspective, some flaws
26
29
  with this approach are:
@@ -89,4 +92,4 @@ The torquebox-sidekiq-service must be loaded before you configure any Sidekiq se
89
92
  Sidekiq assumes your runtime environment is only as a client and will then ignore any server middleware configuration.
90
93
  It'll then go on to use its default server middleware, which can lead to some confusing results. If you're on Rails,
91
94
  everything in your Gemfile will be loaded by default so you won't have anything else to do. Otherwise, make sure you
92
- require the library.
95
+ require the library.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.1.1
@@ -1,6 +1,6 @@
1
1
  module TorqueBox
2
2
  class SidekiqService
3
- attr_accessor :config, :launcher
3
+ attr_accessor :config, :launcher, :start_failed
4
4
 
5
5
  CONFIG_OPTIONS_TO_STRIP = [:config_file, :daemon, :environment, :pidfile, :require, :tag]
6
6
 
@@ -13,7 +13,16 @@ module TorqueBox
13
13
  end
14
14
 
15
15
  def stop
16
- launcher.stop
16
+ # Since the stop call may come before the launcher has finished starting up, try to see
17
+ # if the launcher ever gets initialized. We really don't want to orphan a Sidekiq launcher
18
+ # if we can avoid it.
19
+ Timeout::timeout(5.minutes) do
20
+ while launcher.nil? && !start_failed
21
+ sleep 1
22
+ end
23
+ end
24
+
25
+ launcher.stop if launcher
17
26
  end
18
27
 
19
28
  def run
@@ -36,9 +45,15 @@ module TorqueBox
36
45
  require 'sidekiq/manager'
37
46
  require 'sidekiq/scheduled'
38
47
  require 'sidekiq/launcher'
48
+
39
49
  @launcher = Sidekiq::Launcher.new(Sidekiq.options)
40
50
 
41
51
  launcher.run
52
+ rescue => e
53
+ puts e.message
54
+ puts e.backtrace
55
+
56
+ @start_failed = true
42
57
  end
43
58
  end
44
- end
59
+ end
@@ -5,20 +5,24 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "torquebox-sidekiq-service"
8
- s.version = "0.1.0"
8
+ s.version = "0.1.1"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kevin Menard"]
12
- s.date = "2013-03-14"
12
+ s.date = "2013-03-29"
13
13
  s.description = " The TorqueBox Sidekiq service replaces the traditional Sidekiq CLI client for starting a Sidekiq processor. This\n allows TorqueBox features only available in-container to be usable by all your Sidekiq workers. It has the added\n benefit of reducing memory overhead by running in a single JVM and allows for better optimization through JIT and\n better debugging & profiling through TorqueBox's runtime inspection facilities.\n"
14
14
  s.email = "nirvdrum@gmail.com"
15
15
  s.extra_rdoc_files = [
16
+ "ChangeLog.md",
16
17
  "LICENSE.txt",
17
18
  "README.md"
18
19
  ]
19
20
  s.files = [
21
+ ".travis.yml",
22
+ "ChangeLog.md",
20
23
  "Gemfile",
21
24
  "LICENSE.txt",
25
+ "NOTICE",
22
26
  "README.md",
23
27
  "Rakefile",
24
28
  "VERSION",
@@ -42,17 +46,20 @@ Gem::Specification.new do |s|
42
46
  s.add_runtime_dependency(%q<sidekiq>, [">= 0"])
43
47
  s.add_development_dependency(%q<jeweler>, [">= 0"])
44
48
  s.add_development_dependency(%q<jeweler>, [">= 0"])
49
+ s.add_development_dependency(%q<jeweler>, [">= 0"])
45
50
  else
46
51
  s.add_dependency(%q<torquebox-sidekiq-service>, [">= 0"])
47
52
  s.add_dependency(%q<sidekiq>, [">= 0"])
48
53
  s.add_dependency(%q<jeweler>, [">= 0"])
49
54
  s.add_dependency(%q<jeweler>, [">= 0"])
55
+ s.add_dependency(%q<jeweler>, [">= 0"])
50
56
  end
51
57
  else
52
58
  s.add_dependency(%q<torquebox-sidekiq-service>, [">= 0"])
53
59
  s.add_dependency(%q<sidekiq>, [">= 0"])
54
60
  s.add_dependency(%q<jeweler>, [">= 0"])
55
61
  s.add_dependency(%q<jeweler>, [">= 0"])
62
+ s.add_dependency(%q<jeweler>, [">= 0"])
56
63
  end
57
64
  end
58
65
 
metadata CHANGED
@@ -2,14 +2,14 @@
2
2
  name: torquebox-sidekiq-service
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.0
5
+ version: 0.1.1
6
6
  platform: ruby
7
7
  authors:
8
8
  - Kevin Menard
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-14 00:00:00.000000000 Z
12
+ date: 2013-03-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: torquebox-sidekiq-service
@@ -83,6 +83,24 @@ dependencies:
83
83
  none: false
84
84
  prerelease: false
85
85
  type: :development
86
+ - !ruby/object:Gem::Dependency
87
+ name: jeweler
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: !binary |-
93
+ MA==
94
+ none: false
95
+ requirement: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: !binary |-
100
+ MA==
101
+ none: false
102
+ prerelease: false
103
+ type: :development
86
104
  description: |2
87
105
  The TorqueBox Sidekiq service replaces the traditional Sidekiq CLI client for starting a Sidekiq processor. This
88
106
  allows TorqueBox features only available in-container to be usable by all your Sidekiq workers. It has the added
@@ -92,11 +110,15 @@ email: nirvdrum@gmail.com
92
110
  executables: []
93
111
  extensions: []
94
112
  extra_rdoc_files:
113
+ - ChangeLog.md
95
114
  - LICENSE.txt
96
115
  - README.md
97
116
  files:
117
+ - ".travis.yml"
118
+ - ChangeLog.md
98
119
  - Gemfile
99
120
  - LICENSE.txt
121
+ - NOTICE
100
122
  - README.md
101
123
  - Rakefile
102
124
  - VERSION