resque-pool-diet 0.3.1

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/man/resque-pool.1 ADDED
@@ -0,0 +1,79 @@
1
+ .\" generated with Ronn/v0.7.3
2
+ .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
+ .
4
+ .TH "RESQUE\-POOL" "1" "May 2012" "RESQUE-POOL 0.3.0.DEV" "RESQUE-POOL"
5
+ .
6
+ .SH "NAME"
7
+ \fBresque\-pool\fR \- resque worker pool management
8
+ .
9
+ .SH "SYNOPSIS"
10
+ \fBresque\-pool\fR \fIoptions\fR
11
+ .
12
+ .SH "DESCRIPTION"
13
+ \fBResque\-pool\fR is the best way to manage a group (pool) of resque workers\.
14
+ .
15
+ .P
16
+ When resque\-pool(1) is daemonized the \fBstdout\fR and \fBstderr\fR output streams are redirected to \fBresque\-pool\.stdxxx\.log\fR log files in the \fBlog\fR directory\. Additionally the PID file defaults to \fBresque\-pool\.pid\fR in the \fBtmp/pids\fR directory\.
17
+ .
18
+ .SH "OPTIONS"
19
+ .
20
+ .IP "\(bu" 4
21
+ \fB\-c, \-\-config\fR \fIfile\fR: Uses the configuration specified in the \fIfile\fR provided instead of searching in the current and \fBconfig\fR directories for \fBresque\-pool\.yml\fR\.
22
+ .
23
+ .IP "\(bu" 4
24
+ \fB\-d, \-\-daemon\fR: Runs \fBresque\-pool\fR in the background as a daemon process\. This will redirect \fBstdout\fR and \fBstderr\fR to log files and write a PID file\.
25
+ .
26
+ .IP "\(bu" 4
27
+ \fB\-o, \-\-stdout\fR \fIfile\fR: Writes the normal log output to \fIfile\fR instead of printing to the terminal\. When running as a daemon this defaults to the path \fBlog/resque\-pool\.stdout\.log\fR\.
28
+ .
29
+ .IP "\(bu" 4
30
+ \fB\-e, \-\-stderr\fR \fIfile\fR: Writes the standard error output to \fIfile\fR instead of printing to the terminal\. When running as a daemon this defaults to the path \fBlog/resque\-pool\.stderr\.log\fR\.
31
+ .
32
+ .IP "\(bu" 4
33
+ \fB\-\-nosync\fR Allows writes to \fBstdout\fR and \fBstderr\fR to be buffered by the OS\.
34
+ .
35
+ .IP "\(bu" 4
36
+ \fB\-p, \-\-pidfile\fR \fIfile\fR: Writes the PID to the \fIfile\fR\. When running as a daemon this defaults to \fBtmp/pids/resque\-pool\.pid\fR\.
37
+ .
38
+ .IP "\(bu" 4
39
+ \fB\-E, \-\-environment\fR \fIname\fR: Specifies the environment \fIname\fR to be set for \fBRAILS_ENV\fR, \fBRACK_ENV\fR and \fBRESQUE_ENV\fR which will be passed on to the pooled resque workers\.
40
+ .
41
+ .IP "\(bu" 4
42
+ \fB\-a, \-\-appname\fR \fIname\fR: Specifies the app name to be used for logging and procline\. If not specified, this defaults to the current working directory\.
43
+ .
44
+ .IP "" 0
45
+ .
46
+ .SH "HISTORY"
47
+ .
48
+ .TP
49
+ \fBv0\.3\.0\fR
50
+ Support for ruby 1\.9, resque 1\.20\.
51
+ .
52
+ .br
53
+ Added appname for logging\.
54
+ .
55
+ .br
56
+ Minor bugfixes\.
57
+ .
58
+ .TP
59
+ \fBv0\.2\.0\fR
60
+ Support for reloading logs and workers with \fBHUP\fR signal
61
+ .
62
+ .br
63
+ Cleans up PID file on startup
64
+ .
65
+ .br
66
+ Fixed \fB\-c, \-\-config\fR option\.
67
+ .
68
+ .TP
69
+ \fBv0\.1\.0\fR
70
+ \fBresque\-pool\fR command line interface added
71
+ .
72
+ .SH "AUTHOR"
73
+ Nicholas Evans
74
+ .
75
+ .SH "COPYRIGHT"
76
+ Copyright (C) 2010 by Nicholas Evans \fInick@ekenosen\.net\fR, et al\.
77
+ .
78
+ .SH "SEE ALSO"
79
+ resque\-pool\.yml(5)
@@ -0,0 +1,77 @@
1
+ resque-pool(1) -- resque worker pool management
2
+ ================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `resque-pool` [options]
7
+
8
+ ## DESCRIPTION
9
+
10
+ **Resque-pool** is the best way to manage a group (pool) of resque workers.
11
+
12
+ When resque-pool(1) is daemonized the `stdout` and `stderr` output streams
13
+ are redirected to `resque-pool.stdxxx.log` log files in the `log` directory.
14
+ Additionally the PID file defaults to `resque-pool.pid` in the `tmp/pids`
15
+ directory.
16
+
17
+ ## OPTIONS
18
+
19
+ * `-c, --config` <file>:
20
+ Uses the configuration specified in the <file> provided instead of
21
+ searching in the current and `config` directories for `resque-pool.yml`.
22
+
23
+ * `-d, --daemon`:
24
+ Runs `resque-pool` in the background as a daemon process. This will
25
+ redirect `stdout` and `stderr` to log files and write a PID file.
26
+
27
+ * `-o, --stdout` <file>:
28
+ Writes the normal log output to <file> instead of printing to the
29
+ terminal. When running as a daemon this defaults to the path
30
+ `log/resque-pool.stdout.log`.
31
+
32
+ * `-e, --stderr` <file>:
33
+ Writes the standard error output to <file> instead of printing to the
34
+ terminal. When running as a daemon this defaults to the path
35
+ `log/resque-pool.stderr.log`.
36
+
37
+ * `--nosync`
38
+ Allows writes to `stdout` and `stderr` to be buffered by the OS.
39
+
40
+ * `-p, --pidfile` <file>:
41
+ Writes the PID to the <file>. When running as a daemon this defaults
42
+ to `tmp/pids/resque-pool.pid`.
43
+
44
+ * `-E, --environment` <name>:
45
+ Specifies the environment <name> to be set for `RAILS_ENV`, `RACK_ENV`
46
+ and `RESQUE_ENV` which will be passed on to the pooled resque workers.
47
+
48
+ * `-a, --appname` <name>:
49
+ Specifies the app name to be used for logging and procline. If not
50
+ specified, this defaults to the current working directory.
51
+
52
+ ## HISTORY
53
+
54
+ * `v0.3.0`:
55
+ Support for ruby 1.9, resque 1.20.<br>
56
+ Added appname for logging.<br>
57
+ Minor bugfixes.
58
+
59
+ * `v0.2.0`:
60
+ Support for reloading logs and workers with `HUP` signal<br>
61
+ Cleans up PID file on startup<br>
62
+ Fixed `-c, --config` option.
63
+
64
+ * `v0.1.0`:
65
+ `resque-pool` command line interface added
66
+
67
+ ## AUTHOR
68
+
69
+ Nicholas Evans
70
+
71
+ ## COPYRIGHT
72
+
73
+ Copyright (C) 2010 by Nicholas Evans <nick@ekenosen.net>, et al.
74
+
75
+ ## SEE ALSO
76
+
77
+ resque-pool.yml(5)
@@ -0,0 +1,46 @@
1
+ .\" generated with Ronn/v0.7.3
2
+ .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
+ .
4
+ .TH "RESQUE\-POOL\.YML" "5" "May 2012" "RESQUE-POOL 0.3.0.DEV" "RESQUE-POOL"
5
+ .
6
+ .SH "NAME"
7
+ \fBresque\-pool\.yml\fR \- resque\-pool pool configuration
8
+ .
9
+ .SH "SYNOPSIS"
10
+ \fBresque\-pool\.yml\fR
11
+ .
12
+ .br
13
+ \fBconfig/resque\-pool\.yml\fR
14
+ .
15
+ .SH "DESCRIPTION"
16
+ resque\-pool(1) reads pool configuration data from \fBresque\-pool\.yml\fR (or the file specified with \fB\-c\fR on the command line)\. The file contains queue\-worker\-count pairs, one per line\. The configuration file supports both using root level defaults as well as environment specific overrides (\fBRACK_ENV\fR, \fBRAILS_ENV\fR, and \fBRESQUE_ENV\fR environment variables can be used to determine environment)\.
17
+ .
18
+ .P
19
+ An example configuration
20
+ .
21
+ .IP "" 4
22
+ .
23
+ .nf
24
+
25
+ foo: 1
26
+ bar: 2
27
+ "foo,bar,baz": 1
28
+
29
+ production:
30
+ "foo,bar,baz": 4
31
+ .
32
+ .fi
33
+ .
34
+ .IP "" 0
35
+ .
36
+ .P
37
+ will create 7 workers in production and 4 in other environment configurations\. The simpler worker definition \fBfoo: 1\fR will create 1 worker for the \fBfoo\fR queue, the more complicated \fBfoo,bar,baz: 1\fR will create 1 worker for the queues \fBfoo\fR, \fBbar\fR and \fBbaz\fR\.
38
+ .
39
+ .SH "AUTHOR"
40
+ Nicholas Evans
41
+ .
42
+ .SH "COPYRIGHT"
43
+ Copyright (C) 2010 by Nicholas Evans \fInick@ekenosen\.net\fR, et al\.
44
+ .
45
+ .SH "SEE ALSO"
46
+ resque\-pool(1)
@@ -0,0 +1,41 @@
1
+ resque-pool.yml(5) -- resque-pool pool configuration
2
+ =====================================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `resque-pool.yml`<br>
7
+ `config/resque-pool.yml`
8
+
9
+ ## DESCRIPTION
10
+
11
+ resque-pool(1) reads pool configuration data from `resque-pool.yml` (or
12
+ the file specified with `-c` on the command line). The file contains queue-worker-count pairs, one per line. The configuration file supports both
13
+ using root level defaults as well as environment specific overrides
14
+ (`RACK_ENV`, `RAILS_ENV`, and `RESQUE_ENV` environment variables can be used
15
+ to determine environment).
16
+
17
+ An example configuration
18
+
19
+ foo: 1
20
+ bar: 2
21
+ "foo,bar,baz": 1
22
+
23
+ production:
24
+ "foo,bar,baz": 4
25
+
26
+ will create 7 workers in production and 4 in other environment configurations.
27
+ The simpler worker definition `foo: 1` will create 1 worker for the `foo`
28
+ queue, the more complicated `foo,bar,baz: 1` will create 1 worker for the
29
+ queues `foo`, `bar` and `baz`.
30
+
31
+ ## AUTHOR
32
+
33
+ Nicholas Evans
34
+
35
+ ## COPYRIGHT
36
+
37
+ Copyright (C) 2010 by Nicholas Evans <nick@ekenosen.net>, et al.
38
+
39
+ ## SEE ALSO
40
+
41
+ resque-pool(1)
@@ -0,0 +1,6 @@
1
+ RESQUE_POOL_CONFIG = {
2
+ 'foo' => 1,
3
+ 'bar' => 1,
4
+ 'baz' => 1,
5
+ 'foo,bar,baz' => 4,
6
+ }
@@ -0,0 +1,13 @@
1
+ foo: 1
2
+
3
+ production:
4
+ "foo,bar": 10
5
+
6
+ development:
7
+ "foo,bar": 4
8
+ "baz": 23
9
+
10
+ test:
11
+ "bar": 5
12
+ "foo,bar": 3
13
+
@@ -0,0 +1,134 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.configure do |config|
4
+ config.after {
5
+ Object.send(:remove_const, :RAILS_ENV) if defined? RAILS_ENV
6
+ ENV.delete 'RACK_ENV'
7
+ ENV.delete 'RAILS_ENV'
8
+ ENV.delete 'RESQUE_ENV'
9
+ }
10
+ end
11
+
12
+ describe Resque::Pool, "when loading a simple pool configuration" do
13
+ let(:config) do
14
+ { 'foo' => 1, 'bar' => 2, 'foo,bar' => 3, 'bar,foo' => 4, }
15
+ end
16
+ subject { Resque::Pool.new(config) }
17
+
18
+ context "when ENV['RACK_ENV'] is set" do
19
+ before { ENV['RACK_ENV'] = 'development' }
20
+
21
+ it "should load the values from the Hash" do
22
+ subject.config["foo"].should == 1
23
+ subject.config["bar"].should == 2
24
+ subject.config["foo,bar"].should == 3
25
+ subject.config["bar,foo"].should == 4
26
+ end
27
+ end
28
+
29
+ end
30
+
31
+ describe Resque::Pool, "when loading the pool configuration from a Hash" do
32
+
33
+ let(:config) do
34
+ {
35
+ 'foo' => 8,
36
+ 'test' => { 'bar' => 10, 'foo,bar' => 12 },
37
+ 'development' => { 'baz' => 14, 'foo,bar' => 16 },
38
+ }
39
+ end
40
+
41
+ subject { Resque::Pool.new(config) }
42
+
43
+ context "when RAILS_ENV is set" do
44
+ before { RAILS_ENV = "test" }
45
+
46
+ it "should load the default values from the Hash" do
47
+ subject.config["foo"].should == 8
48
+ end
49
+
50
+ it "should merge the values for the correct RAILS_ENV" do
51
+ subject.config["bar"].should == 10
52
+ subject.config["foo,bar"].should == 12
53
+ end
54
+
55
+ it "should not load the values for the other environments" do
56
+ subject.config["foo,bar"].should == 12
57
+ subject.config["baz"].should be_nil
58
+ end
59
+
60
+ end
61
+
62
+ context "when ENV['RESQUE_ENV'] is set" do
63
+ before { ENV['RESQUE_ENV'] = 'development' }
64
+ it "should load the config for that environment" do
65
+ subject.config["foo"].should == 8
66
+ subject.config["foo,bar"].should == 16
67
+ subject.config["baz"].should == 14
68
+ subject.config["bar"].should be_nil
69
+ end
70
+ end
71
+
72
+ context "when there is no environment" do
73
+ it "should load the default values only" do
74
+ subject.config["foo"].should == 8
75
+ subject.config["bar"].should be_nil
76
+ subject.config["foo,bar"].should be_nil
77
+ subject.config["baz"].should be_nil
78
+ end
79
+ end
80
+
81
+ end
82
+
83
+ describe Resque::Pool, "given no configuration" do
84
+ subject { Resque::Pool.new(nil) }
85
+ it "should have no worker types" do
86
+ subject.config.should == {}
87
+ end
88
+ end
89
+
90
+ describe Resque::Pool, "when loading the pool configuration from a file" do
91
+
92
+ subject { Resque::Pool.new("spec/resque-pool.yml") }
93
+
94
+ context "when RAILS_ENV is set" do
95
+ before { RAILS_ENV = "test" }
96
+
97
+ it "should load the default YAML" do
98
+ subject.config["foo"].should == 1
99
+ end
100
+
101
+ it "should merge the YAML for the correct RAILS_ENV" do
102
+ subject.config["bar"].should == 5
103
+ subject.config["foo,bar"].should == 3
104
+ end
105
+
106
+ it "should not load the YAML for the other environments" do
107
+ subject.config["foo"].should == 1
108
+ subject.config["bar"].should == 5
109
+ subject.config["foo,bar"].should == 3
110
+ subject.config["baz"].should be_nil
111
+ end
112
+
113
+ end
114
+
115
+ context "when ENV['RACK_ENV'] is set" do
116
+ before { ENV['RACK_ENV'] = 'development' }
117
+ it "should load the config for that environment" do
118
+ subject.config["foo"].should == 1
119
+ subject.config["foo,bar"].should == 4
120
+ subject.config["baz"].should == 23
121
+ subject.config["bar"].should be_nil
122
+ end
123
+ end
124
+
125
+ context "when there is no environment" do
126
+ it "should load the default values only" do
127
+ subject.config["foo"].should == 1
128
+ subject.config["bar"].should be_nil
129
+ subject.config["foo,bar"].should be_nil
130
+ subject.config["baz"].should be_nil
131
+ end
132
+ end
133
+
134
+ end
@@ -0,0 +1,3 @@
1
+ require 'rspec'
2
+ $LOAD_PATH << File.expand_path("../lib", File.dirname(__FILE__))
3
+ require 'resque/pool'
metadata ADDED
@@ -0,0 +1,191 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: resque-pool-diet
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.3.1
5
+ platform: ruby
6
+ authors:
7
+ - nicholas a. evans
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-06-18 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: resque
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.20'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.20'
27
+ - !ruby/object:Gem::Dependency
28
+ name: trollop
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.16'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.16'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rake
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: rspec
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 2.9.0
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 2.9.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: cucumber
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 1.1.9
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 1.1.9
83
+ - !ruby/object:Gem::Dependency
84
+ name: aruba
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: 0.4.11
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: 0.4.11
97
+ - !ruby/object:Gem::Dependency
98
+ name: bundler
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '1.0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '1.0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: ronn
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ description: |2
126
+ quickly and easily fork a pool of resque workers,
127
+ saving memory (w/REE) and monitoring their uptime
128
+ email:
129
+ - nick@ekenosen.net
130
+ executables:
131
+ - resque-pool
132
+ extensions: []
133
+ extra_rdoc_files: []
134
+ files:
135
+ - Changelog.md
136
+ - LICENSE.txt
137
+ - README.md
138
+ - Rakefile
139
+ - bin/resque-pool
140
+ - features/basic_daemon_config.feature
141
+ - features/step_definitions/daemon_steps.rb
142
+ - features/step_definitions/resque-pool_steps.rb
143
+ - features/support/aruba_daemon_support.rb
144
+ - features/support/env.rb
145
+ - lib/resque/pool.rb
146
+ - lib/resque/pool/cli.rb
147
+ - lib/resque/pool/logging.rb
148
+ - lib/resque/pool/pooled_worker.rb
149
+ - lib/resque/pool/tasks.rb
150
+ - lib/resque/pool/version.rb
151
+ - man/resque-pool.1
152
+ - man/resque-pool.1.ronn
153
+ - man/resque-pool.yml.5
154
+ - man/resque-pool.yml.5.ronn
155
+ - spec/mock_config.rb
156
+ - spec/resque-pool.yml
157
+ - spec/resque_pool_spec.rb
158
+ - spec/spec_helper.rb
159
+ homepage: http://github.com/nevans/resque-pool
160
+ licenses: []
161
+ metadata: {}
162
+ post_install_message:
163
+ rdoc_options: []
164
+ require_paths:
165
+ - lib
166
+ required_ruby_version: !ruby/object:Gem::Requirement
167
+ requirements:
168
+ - - ">="
169
+ - !ruby/object:Gem::Version
170
+ version: '0'
171
+ required_rubygems_version: !ruby/object:Gem::Requirement
172
+ requirements:
173
+ - - ">="
174
+ - !ruby/object:Gem::Version
175
+ version: '0'
176
+ requirements: []
177
+ rubyforge_project:
178
+ rubygems_version: 2.2.2
179
+ signing_key:
180
+ specification_version: 4
181
+ summary: quickly and easily fork a pool of resque workers
182
+ test_files:
183
+ - spec/mock_config.rb
184
+ - spec/resque_pool_spec.rb
185
+ - spec/spec_helper.rb
186
+ - spec/resque-pool.yml
187
+ - features/step_definitions/daemon_steps.rb
188
+ - features/step_definitions/resque-pool_steps.rb
189
+ - features/support/aruba_daemon_support.rb
190
+ - features/support/env.rb
191
+ - features/basic_daemon_config.feature