puma 1.1.1-java → 1.2.0-java
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puma might be problematic. Click here for more details.
- data/History.txt +26 -51
- data/README.md +2 -0
- data/Rakefile +1 -0
- data/bin/puma +1 -7
- data/lib/puma/app/status.rb +2 -1
- data/lib/puma/cli.rb +127 -20
- data/lib/puma/configuration.rb +14 -0
- data/lib/puma/const.rb +2 -1
- data/lib/puma/puma_http11.jar +0 -0
- data/lib/puma/server.rb +62 -13
- data/puma.gemspec +10 -9
- metadata +3 -3
data/History.txt
CHANGED
@@ -1,69 +1,44 @@
|
|
1
|
-
=== 1.2.0
|
1
|
+
=== 1.2.0 / 2012-04-11
|
2
2
|
|
3
|
-
|
3
|
+
1 major feature:
|
4
4
|
|
5
|
-
*
|
6
|
-
|
7
|
-
* Smartly load http11 extension using fat-binary approach.
|
8
|
-
* Better detection of Windows platform (usage of RbConfig::CONFIG instead of RUBY_PLATFORM)
|
5
|
+
* When possible, the internal restart does a "hot restart" meaning
|
6
|
+
the server sockets remains open, so no connections are lost.
|
9
7
|
|
10
|
-
|
8
|
+
1 minor feature:
|
11
9
|
|
12
|
-
*
|
13
|
-
* Consider MinGW as valid Windows platform.
|
14
|
-
* Properly drop PID when daemonizing (EngineYard patched 1.1.5.1).
|
10
|
+
* More helpful fallback error message
|
15
11
|
|
16
|
-
|
12
|
+
6 bug fixes:
|
17
13
|
|
18
|
-
*
|
19
|
-
*
|
20
|
-
*
|
21
|
-
*
|
22
|
-
*
|
14
|
+
* Pass the proper args to unknown_error. Fixes #54, #58
|
15
|
+
* Stop the control server before restarting. Fixes #61
|
16
|
+
* Fix reporting https only on a true SSL connection
|
17
|
+
* Set the default content type to 'text/plain'. Fixes #63
|
18
|
+
* Use REUSEADDR. Fixes #60
|
19
|
+
* Shutdown gracefull on SIGTERM. Fixes #53
|
23
20
|
|
24
|
-
|
21
|
+
2 new contributers:
|
25
22
|
|
26
|
-
*
|
23
|
+
* Seamus Abshere
|
24
|
+
* Steve Richert
|
27
25
|
|
26
|
+
=== 1.1.1 / 2012-03-30
|
28
27
|
|
29
|
-
|
28
|
+
1 bugfix:
|
30
29
|
|
31
|
-
*
|
30
|
+
* Include puma/compat.rb in the gem (oops!)
|
32
31
|
|
32
|
+
=== 1.1.0 / 2012-03-30
|
33
33
|
|
34
|
-
|
34
|
+
1 bugfix:
|
35
35
|
|
36
|
-
*
|
36
|
+
* Make sure that the unix socket has the perms 0777 by default
|
37
37
|
|
38
|
+
1 minor feature:
|
38
39
|
|
39
|
-
|
40
|
+
* Add umask param to the unix:// bind to set the umask
|
40
41
|
|
41
|
-
|
42
|
+
=== 1.0.0 / 2012-03-29
|
42
43
|
|
43
|
-
|
44
|
-
=== 1.1.1 / 2007-11-12
|
45
|
-
|
46
|
-
* Fix mongrel_rails restart bug; fix bug with Rack status codes.
|
47
|
-
|
48
|
-
|
49
|
-
=== 1.1 / 2007-11-01
|
50
|
-
|
51
|
-
* Pure Ruby URIClassifier.
|
52
|
-
* More modular architecture.
|
53
|
-
* JRuby support.
|
54
|
-
* Move C URIClassifier into mongrel_experimental project.
|
55
|
-
|
56
|
-
|
57
|
-
=== 1.0.4 / 2007-10-29
|
58
|
-
|
59
|
-
* Backport fixes for versioning inconsistency, mongrel_rails bug, and DirHandler bug.
|
60
|
-
|
61
|
-
|
62
|
-
=== 1.0.3
|
63
|
-
|
64
|
-
* Fix user-switching bug; make people upgrade to the latest from the RC.
|
65
|
-
|
66
|
-
|
67
|
-
=== 1.0.2
|
68
|
-
|
69
|
-
* Signed gem; many minor bugfixes and patches.
|
44
|
+
* Released!
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Puma: A Ruby Web Server Built For Concurrency
|
2
2
|
|
3
|
+
[![Build Status](https://secure.travis-ci.org/puma/puma.png)](http://travis-ci.org/puma/puma) [![Dependency Status](https://gemnasium.com/puma/puma.png)](https://gemnasium.com/puma/puma)
|
4
|
+
|
3
5
|
## Description
|
4
6
|
|
5
7
|
Puma is a simple, fast, and highly concurrent HTTP 1.1 server for Ruby web applications. It can be used with any application that supports Rack, and is considered the replacement for Webrick and Mongrel. It was designed to be the go-to server for [Rubinius](http://rubini.us), but also works well with JRuby and MRI. Puma is intended for use in both development and production environments.
|
data/Rakefile
CHANGED
data/bin/puma
CHANGED
data/lib/puma/app/status.rb
CHANGED
data/lib/puma/cli.rb
CHANGED
@@ -33,9 +33,26 @@ module Puma
|
|
33
33
|
@restart = false
|
34
34
|
@temp_status_path = nil
|
35
35
|
|
36
|
+
@listeners = []
|
37
|
+
|
36
38
|
setup_options
|
37
39
|
|
38
40
|
generate_restart_data
|
41
|
+
|
42
|
+
@inherited_fds = {}
|
43
|
+
remove = []
|
44
|
+
|
45
|
+
ENV.each do |k,v|
|
46
|
+
if k =~ /PUMA_INHERIT_\d+/
|
47
|
+
fd, url = v.split(":", 2)
|
48
|
+
@inherited_fds[url] = fd.to_i
|
49
|
+
remove << k
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
remove.each do |k|
|
54
|
+
ENV.delete k
|
55
|
+
end
|
39
56
|
end
|
40
57
|
|
41
58
|
def restart_on_stop!
|
@@ -62,6 +79,8 @@ module Puma
|
|
62
79
|
|
63
80
|
@restart_dir ||= Dir.pwd
|
64
81
|
|
82
|
+
@original_argv = ARGV.dup
|
83
|
+
|
65
84
|
if defined? Rubinius::OS_ARGV
|
66
85
|
@restart_argv = Rubinius::OS_ARGV
|
67
86
|
else
|
@@ -72,20 +91,47 @@ module Puma
|
|
72
91
|
# picked up in PATH.
|
73
92
|
#
|
74
93
|
if File.exists?($0)
|
75
|
-
|
94
|
+
arg0 = [Gem.ruby, $0]
|
76
95
|
else
|
77
|
-
|
96
|
+
arg0 = [Gem.ruby, "-S", $0]
|
78
97
|
end
|
98
|
+
|
99
|
+
@restart_argv = arg0 + ARGV
|
79
100
|
end
|
80
101
|
end
|
81
102
|
|
82
103
|
def restart!
|
104
|
+
@options[:on_restart].each do |blk|
|
105
|
+
blk.call self
|
106
|
+
end
|
107
|
+
|
83
108
|
if IS_JRUBY
|
109
|
+
@listeners.each_with_index do |(str,io),i|
|
110
|
+
io.close
|
111
|
+
|
112
|
+
# We have to unlink a unix socket path that's not being used
|
113
|
+
uri = URI.parse str
|
114
|
+
if uri.scheme == "unix"
|
115
|
+
path = "#{uri.host}#{uri.path}"
|
116
|
+
File.unlink path
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
84
120
|
require 'puma/jruby_restart'
|
85
121
|
JRubyRestart.chdir_exec(@restart_dir, Gem.ruby, *@restart_argv)
|
86
122
|
else
|
123
|
+
@listeners.each_with_index do |(l,io),i|
|
124
|
+
ENV["PUMA_INHERIT_#{i}"] = "#{io.to_i}:#{l}"
|
125
|
+
end
|
126
|
+
|
127
|
+
if cmd = @options[:restart_cmd]
|
128
|
+
argv = cmd.split(' ') + @original_argv
|
129
|
+
else
|
130
|
+
argv = @restart_argv
|
131
|
+
end
|
132
|
+
|
87
133
|
Dir.chdir @restart_dir
|
88
|
-
Kernel.exec(
|
134
|
+
Kernel.exec(*argv)
|
89
135
|
end
|
90
136
|
end
|
91
137
|
|
@@ -163,6 +209,11 @@ module Puma
|
|
163
209
|
end
|
164
210
|
end
|
165
211
|
|
212
|
+
o.on "--restart-cmd CMD",
|
213
|
+
"The puma command to run during a hot restart",
|
214
|
+
"Default: inferred" do |cmd|
|
215
|
+
@options[:restart_cmd] = cmd
|
216
|
+
end
|
166
217
|
end
|
167
218
|
|
168
219
|
@parser.banner = "puma <options> <rackup file>"
|
@@ -190,7 +241,10 @@ module Puma
|
|
190
241
|
if path = @options[:state]
|
191
242
|
state = { "pid" => Process.pid }
|
192
243
|
|
193
|
-
|
244
|
+
cfg = @config.dup
|
245
|
+
cfg.options.delete :on_restart
|
246
|
+
|
247
|
+
state["config"] = cfg
|
194
248
|
|
195
249
|
File.open(path, "w") do |f|
|
196
250
|
f.write state.to_yaml
|
@@ -212,6 +266,12 @@ module Puma
|
|
212
266
|
@temp_status_path = @options[:control_path_temp]
|
213
267
|
end
|
214
268
|
|
269
|
+
def graceful_stop(server)
|
270
|
+
log " - Gracefully stopping, waiting for requests to finish"
|
271
|
+
server.stop(true)
|
272
|
+
log " - Goodbye!"
|
273
|
+
end
|
274
|
+
|
215
275
|
# Parse the options, load the rackup, start the server and wait
|
216
276
|
# for it to finish.
|
217
277
|
#
|
@@ -237,25 +297,38 @@ module Puma
|
|
237
297
|
uri = URI.parse str
|
238
298
|
case uri.scheme
|
239
299
|
when "tcp"
|
240
|
-
|
241
|
-
|
300
|
+
if fd = @inherited_fds.delete(str)
|
301
|
+
log "* Inherited #{str}"
|
302
|
+
io = server.inherit_tcp_listener uri.host, uri.port, fd
|
303
|
+
else
|
304
|
+
log "* Listening on #{str}"
|
305
|
+
io = server.add_tcp_listener uri.host, uri.port
|
306
|
+
end
|
307
|
+
|
308
|
+
@listeners << [str, io]
|
242
309
|
when "unix"
|
243
|
-
|
244
|
-
|
310
|
+
if fd = @inherited_fds.delete(str)
|
311
|
+
log "* Inherited #{str}"
|
312
|
+
io = server.inherit_unix_listener uri.path, fd
|
313
|
+
else
|
314
|
+
log "* Listening on #{str}"
|
315
|
+
path = "#{uri.host}#{uri.path}"
|
245
316
|
|
246
|
-
|
317
|
+
umask = nil
|
247
318
|
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
319
|
+
if uri.query
|
320
|
+
params = Rack::Utils.parse_query uri.query
|
321
|
+
if u = params['umask']
|
322
|
+
# Use Integer() to respect the 0 prefix as octal
|
323
|
+
umask = Integer(u)
|
324
|
+
end
|
253
325
|
end
|
326
|
+
|
327
|
+
io = server.add_unix_listener path, umask
|
254
328
|
end
|
255
329
|
|
256
|
-
|
330
|
+
@listeners << [str, io]
|
257
331
|
when "ssl"
|
258
|
-
log "* Listening on #{str}"
|
259
332
|
params = Rack::Utils.parse_query uri.query
|
260
333
|
require 'openssl'
|
261
334
|
|
@@ -274,12 +347,38 @@ module Puma
|
|
274
347
|
|
275
348
|
ctx.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
276
349
|
|
277
|
-
|
350
|
+
if fd = @inherited_fds.delete(str)
|
351
|
+
log "* Inherited #{str}"
|
352
|
+
io = server.inherited_ssl_listener fd, ctx
|
353
|
+
else
|
354
|
+
log "* Listening on #{str}"
|
355
|
+
io = server.add_ssl_listener uri.host, uri.port, ctx
|
356
|
+
end
|
357
|
+
|
358
|
+
@listeners << [str, io]
|
278
359
|
else
|
279
360
|
error "Invalid URI: #{str}"
|
280
361
|
end
|
281
362
|
end
|
282
363
|
|
364
|
+
# If we inherited fds but didn't use them (because of a
|
365
|
+
# configuration change), then be sure to close them.
|
366
|
+
@inherited_fds.each do |str, fd|
|
367
|
+
log "* Closing unused inherited connection: #{str}"
|
368
|
+
|
369
|
+
begin
|
370
|
+
IO.for_fd(fd).close
|
371
|
+
rescue SystemCallError
|
372
|
+
end
|
373
|
+
|
374
|
+
# We have to unlink a unix socket path that's not being used
|
375
|
+
uri = URI.parse str
|
376
|
+
if uri.scheme == "unix"
|
377
|
+
path = "#{uri.host}#{uri.path}"
|
378
|
+
File.unlink path
|
379
|
+
end
|
380
|
+
end
|
381
|
+
|
283
382
|
@server = server
|
284
383
|
|
285
384
|
if str = @options[:control_url]
|
@@ -314,20 +413,28 @@ module Puma
|
|
314
413
|
@status = status
|
315
414
|
end
|
316
415
|
|
416
|
+
Signal.trap "SIGUSR2" do
|
417
|
+
@restart = true
|
418
|
+
server.begin_restart
|
419
|
+
end
|
420
|
+
|
421
|
+
Signal.trap "SIGTERM" do
|
422
|
+
graceful_stop server
|
423
|
+
end
|
424
|
+
|
317
425
|
log "Use Ctrl-C to stop"
|
318
426
|
|
319
427
|
begin
|
320
428
|
server.run.join
|
321
429
|
rescue Interrupt
|
322
|
-
|
323
|
-
server.stop(true)
|
324
|
-
log " - Goodbye!"
|
430
|
+
graceful_stop server
|
325
431
|
end
|
326
432
|
|
327
433
|
File.unlink @temp_status_path if @temp_status_path
|
328
434
|
|
329
435
|
if @restart
|
330
436
|
log "* Restarting..."
|
437
|
+
@status.stop true
|
331
438
|
restart!
|
332
439
|
end
|
333
440
|
end
|
data/lib/puma/configuration.rb
CHANGED
@@ -8,10 +8,15 @@ module Puma
|
|
8
8
|
def initialize(options)
|
9
9
|
@options = options
|
10
10
|
@options[:binds] ||= []
|
11
|
+
@options[:on_restart] ||= []
|
11
12
|
end
|
12
13
|
|
13
14
|
attr_reader :options
|
14
15
|
|
16
|
+
def initialize_copy(other)
|
17
|
+
@options = @options.dup
|
18
|
+
end
|
19
|
+
|
15
20
|
def load
|
16
21
|
if path = @options[:config_file]
|
17
22
|
DSL.new(@options)._load_from path
|
@@ -150,6 +155,15 @@ module Puma
|
|
150
155
|
@options[:binds] << url
|
151
156
|
end
|
152
157
|
|
158
|
+
# Code to run before doing a restart. This code should
|
159
|
+
# close logfiles, database connections, etc.
|
160
|
+
#
|
161
|
+
# This can be called multiple times to add code each time.
|
162
|
+
#
|
163
|
+
def on_restart(&blk)
|
164
|
+
@options[:on_restart] << blk
|
165
|
+
end
|
166
|
+
|
153
167
|
# Store the pid of the server in the file at +path+.
|
154
168
|
def pidfile(path)
|
155
169
|
@options[:pidfile] = path
|
data/lib/puma/const.rb
CHANGED
@@ -75,7 +75,7 @@ module Puma
|
|
75
75
|
|
76
76
|
PATH_INFO = 'PATH_INFO'.freeze
|
77
77
|
|
78
|
-
PUMA_VERSION = VERSION = "1.
|
78
|
+
PUMA_VERSION = VERSION = "1.2.0".freeze
|
79
79
|
|
80
80
|
PUMA_TMP_BASE = "puma".freeze
|
81
81
|
|
@@ -133,6 +133,7 @@ module Puma
|
|
133
133
|
|
134
134
|
STOP_COMMAND = "?".freeze
|
135
135
|
HALT_COMMAND = "!".freeze
|
136
|
+
RESTART_COMMAND = "R".freeze
|
136
137
|
|
137
138
|
RACK_INPUT = "rack.input".freeze
|
138
139
|
RACK_URL_SCHEME = "rack.url_scheme".freeze
|
data/lib/puma/puma_http11.jar
CHANGED
Binary file
|
data/lib/puma/server.rb
CHANGED
@@ -63,13 +63,20 @@ module Puma
|
|
63
63
|
"rack.multiprocess".freeze => false,
|
64
64
|
"rack.run_once".freeze => true,
|
65
65
|
"SCRIPT_NAME".freeze => "",
|
66
|
-
|
66
|
+
|
67
|
+
# Rack blows up if this is an empty string, and Rack::Lint
|
68
|
+
# blows up if it's nil. So 'text/plain' seems like the most
|
69
|
+
# sensible default value.
|
70
|
+
"CONTENT_TYPE".freeze => "text/plain",
|
71
|
+
|
67
72
|
"QUERY_STRING".freeze => "",
|
68
73
|
SERVER_PROTOCOL => HTTP_11,
|
69
74
|
SERVER_SOFTWARE => PUMA_VERSION,
|
70
75
|
GATEWAY_INTERFACE => CGI_VER
|
71
76
|
}
|
72
77
|
|
78
|
+
@envs = {}
|
79
|
+
|
73
80
|
ENV['RACK_ENV'] ||= "development"
|
74
81
|
end
|
75
82
|
|
@@ -107,8 +114,16 @@ module Puma
|
|
107
114
|
if optimize_for_latency
|
108
115
|
s.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
|
109
116
|
end
|
117
|
+
s.setsockopt(Socket::SOL_SOCKET,Socket::SO_REUSEADDR, true)
|
110
118
|
s.listen backlog
|
111
119
|
@ios << s
|
120
|
+
s
|
121
|
+
end
|
122
|
+
|
123
|
+
def inherit_tcp_listener(host, port, fd)
|
124
|
+
s = TCPServer.for_fd(fd)
|
125
|
+
@ios << s
|
126
|
+
s
|
112
127
|
end
|
113
128
|
|
114
129
|
def add_ssl_listener(host, port, ctx, optimize_for_latency=true, backlog=1024)
|
@@ -116,9 +131,21 @@ module Puma
|
|
116
131
|
if optimize_for_latency
|
117
132
|
s.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
|
118
133
|
end
|
134
|
+
s.setsockopt(Socket::SOL_SOCKET,Socket::SO_REUSEADDR, true)
|
119
135
|
s.listen backlog
|
120
|
-
|
136
|
+
|
137
|
+
env = @proto_env.dup
|
138
|
+
env[HTTPS_KEY] = HTTPS
|
139
|
+
@envs[s] = env
|
140
|
+
|
141
|
+
@ios << OpenSSL::SSL::SSLServer.new(s, ctx)
|
142
|
+
s
|
143
|
+
end
|
144
|
+
|
145
|
+
def inherited_ssl_listener(fd, ctx)
|
146
|
+
s = TCPServer.for_fd(fd)
|
121
147
|
@ios << OpenSSL::SSL::SSLServer.new(s, ctx)
|
148
|
+
s
|
122
149
|
end
|
123
150
|
|
124
151
|
# Tell the server to listen on +path+ as a UNIX domain socket.
|
@@ -131,10 +158,22 @@ module Puma
|
|
131
158
|
|
132
159
|
begin
|
133
160
|
old_mask = File.umask(umask)
|
134
|
-
|
161
|
+
s = UNIXServer.new(path)
|
162
|
+
@ios << s
|
135
163
|
ensure
|
136
164
|
File.umask old_mask
|
137
165
|
end
|
166
|
+
|
167
|
+
s
|
168
|
+
end
|
169
|
+
|
170
|
+
def inherit_unix_listener(path, fd)
|
171
|
+
@unix_paths << path
|
172
|
+
|
173
|
+
s = UNIXServer.for_fd fd
|
174
|
+
@ios << s
|
175
|
+
|
176
|
+
s
|
138
177
|
end
|
139
178
|
|
140
179
|
def backlog
|
@@ -153,8 +192,8 @@ module Puma
|
|
153
192
|
|
154
193
|
@status = :run
|
155
194
|
|
156
|
-
@thread_pool = ThreadPool.new(@min_threads, @max_threads) do |client|
|
157
|
-
process_client(client)
|
195
|
+
@thread_pool = ThreadPool.new(@min_threads, @max_threads) do |client, env|
|
196
|
+
process_client(client, env)
|
158
197
|
end
|
159
198
|
|
160
199
|
if @auto_trim_time
|
@@ -174,7 +213,7 @@ module Puma
|
|
174
213
|
if sock == check
|
175
214
|
break if handle_check
|
176
215
|
else
|
177
|
-
pool << sock.accept
|
216
|
+
pool << [sock.accept, @envs.fetch(sock, @proto_env)]
|
178
217
|
end
|
179
218
|
end
|
180
219
|
rescue Errno::ECONNABORTED
|
@@ -187,8 +226,10 @@ module Puma
|
|
187
226
|
|
188
227
|
graceful_shutdown if @status == :stop
|
189
228
|
ensure
|
190
|
-
@
|
191
|
-
|
229
|
+
unless @status == :restart
|
230
|
+
@ios.each { |i| i.close }
|
231
|
+
@unix_paths.each { |i| File.unlink i }
|
232
|
+
end
|
192
233
|
end
|
193
234
|
end
|
194
235
|
|
@@ -206,6 +247,9 @@ module Puma
|
|
206
247
|
when HALT_COMMAND
|
207
248
|
@status = :halt
|
208
249
|
return true
|
250
|
+
when RESTART_COMMAND
|
251
|
+
@status = :restart
|
252
|
+
return true
|
209
253
|
end
|
210
254
|
|
211
255
|
return false
|
@@ -217,7 +261,7 @@ module Puma
|
|
217
261
|
# indicates that it supports keep alive, wait for another request before
|
218
262
|
# returning.
|
219
263
|
#
|
220
|
-
def process_client(client)
|
264
|
+
def process_client(client, proto_env)
|
221
265
|
parser = HttpParser.new
|
222
266
|
close_socket = true
|
223
267
|
|
@@ -225,7 +269,7 @@ module Puma
|
|
225
269
|
while true
|
226
270
|
parser.reset
|
227
271
|
|
228
|
-
env =
|
272
|
+
env = proto_env.dup
|
229
273
|
data = client.readpartial(CHUNK_SIZE)
|
230
274
|
nparsed = 0
|
231
275
|
|
@@ -286,7 +330,7 @@ module Puma
|
|
286
330
|
|
287
331
|
# Server error
|
288
332
|
rescue StandardError => e
|
289
|
-
@events.unknown_error self,
|
333
|
+
@events.unknown_error self, e, "Read"
|
290
334
|
|
291
335
|
ensure
|
292
336
|
begin
|
@@ -294,7 +338,7 @@ module Puma
|
|
294
338
|
rescue IOError, SystemCallError
|
295
339
|
# Already closed
|
296
340
|
rescue StandardError => e
|
297
|
-
@events.unknown_error self,
|
341
|
+
@events.unknown_error self, e, "Client"
|
298
342
|
end
|
299
343
|
end
|
300
344
|
end
|
@@ -560,7 +604,7 @@ module Puma
|
|
560
604
|
# A fallback rack response if +@app+ raises as exception.
|
561
605
|
#
|
562
606
|
def lowlevel_error(e)
|
563
|
-
[500, {}, ["
|
607
|
+
[500, {}, ["Puma caught this error:\n#{e.backtrace.join("\n")}"]]
|
564
608
|
end
|
565
609
|
|
566
610
|
# Wait for all outstanding requests to finish.
|
@@ -585,5 +629,10 @@ module Puma
|
|
585
629
|
|
586
630
|
@thread.join if @thread && sync
|
587
631
|
end
|
632
|
+
|
633
|
+
def begin_restart
|
634
|
+
@persistent_wakeup.close
|
635
|
+
@notify << RESTART_COMMAND
|
636
|
+
end
|
588
637
|
end
|
589
638
|
end
|
data/puma.gemspec
CHANGED
@@ -2,22 +2,23 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "puma"
|
5
|
-
s.version = "1.
|
5
|
+
s.version = "1.2.0"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Evan Phoenix"]
|
9
|
-
s.date = "2012-
|
9
|
+
s.date = "2012-04-11"
|
10
10
|
s.description = "Puma is a simple, fast, and highly concurrent HTTP 1.1 server for Ruby web applications. It can be used with any application that supports Rack, and is considered the replacement for Webrick and Mongrel. It was designed to be the go-to server for [Rubinius](http://rubini.us), but also works well with JRuby and MRI. Puma is intended for use in both development and production environments.\n\nUnder the hood, Puma processes requests using a C-optimized Ragel extension (inherited from Mongrel) that provides fast, accurate HTTP 1.1 protocol parsing in a portable way. Puma then serves the request in a thread from an internal thread pool (which you can control). This allows Puma to provide real concurrency for your web application!\n\nWith Rubinius 2.0, Puma will utilize all cores on your CPU with real threads, meaning you won't have to spawn multiple processes to increase throughput. You can expect to see a similar benefit from JRuby.\n\nOn MRI, there is a Global Interpreter Lock (GIL) that ensures only one thread can be run at a time. But if you're doing a lot of blocking IO (such as HTTP calls to external APIs like Twitter), Puma still improves MRI's throughput by allowing blocking IO to be run concurrently (EventMachine-based servers such as Thin turn off this ability, requiring you to use special libraries). Your mileage may vary. In order to get the best throughput, it is highly recommended that you use a Ruby implementation with real threads like [Rubinius](http://rubini.us) or [JRuby](http://jruby.org)."
|
11
11
|
s.email = ["evan@phx.io"]
|
12
12
|
s.executables = ["puma", "pumactl"]
|
13
13
|
s.extensions = ["ext/puma_http11/extconf.rb"]
|
14
14
|
s.extra_rdoc_files = ["History.txt", "Manifest.txt"]
|
15
15
|
s.files = ["COPYING", "Gemfile", "History.txt", "LICENSE", "Manifest.txt", "README.md", "Rakefile", "TODO", "bin/puma", "bin/pumactl", "examples/CA/cacert.pem", "examples/CA/newcerts/cert_1.pem", "examples/CA/newcerts/cert_2.pem", "examples/CA/private/cakeypair.pem", "examples/CA/serial", "examples/config.rb", "examples/puma/cert_puma.pem", "examples/puma/csr_puma.pem", "examples/puma/puma_keypair.pem", "examples/qc_config.rb", "ext/puma_http11/PumaHttp11Service.java", "ext/puma_http11/ext_help.h", "ext/puma_http11/extconf.rb", "ext/puma_http11/http11_parser.c", "ext/puma_http11/http11_parser.h", "ext/puma_http11/http11_parser.java.rl", "ext/puma_http11/http11_parser.rl", "ext/puma_http11/http11_parser_common.rl", "ext/puma_http11/org/jruby/puma/Http11.java", "ext/puma_http11/org/jruby/puma/Http11Parser.java", "ext/puma_http11/puma_http11.c", "lib/puma.rb", "lib/puma/app/status.rb", "lib/puma/cli.rb", "lib/puma/compat.rb", "lib/puma/configuration.rb", "lib/puma/const.rb", "lib/puma/control_cli.rb", "lib/puma/events.rb", "lib/puma/jruby_restart.rb", "lib/puma/null_io.rb", "lib/puma/rack_patch.rb", "lib/puma/server.rb", "lib/puma/thread_pool.rb", "lib/rack/handler/puma.rb", "puma.gemspec", "test/ab_rs.rb", "test/config/app.rb", "test/hello.ru", "test/lobster.ru", "test/mime.yaml", "test/slow.ru", "test/test_app_status.rb", "test/test_cli.rb", "test/test_config.rb", "test/test_http10.rb", "test/test_http11.rb", "test/test_integration.rb", "test/test_persistent.rb", "test/test_rack_handler.rb", "test/test_rack_server.rb", "test/test_thread_pool.rb", "test/test_unix_socket.rb", "test/test_ws.rb", "test/testhelp.rb", "tools/trickletest.rb"]
|
16
|
+
s.homepage = "http://puma.io"
|
16
17
|
s.rdoc_options = ["--main", "README.md"]
|
17
18
|
s.require_paths = ["lib"]
|
18
19
|
s.required_ruby_version = Gem::Requirement.new(">= 1.8.7")
|
19
20
|
s.rubyforge_project = "puma"
|
20
|
-
s.rubygems_version = "1.8.
|
21
|
+
s.rubygems_version = "1.8.21"
|
21
22
|
s.summary = "Puma is a simple, fast, and highly concurrent HTTP 1.1 server for Ruby web applications"
|
22
23
|
s.test_files = ["test/test_app_status.rb", "test/test_cli.rb", "test/test_config.rb", "test/test_http10.rb", "test/test_http11.rb", "test/test_integration.rb", "test/test_persistent.rb", "test/test_rack_handler.rb", "test/test_rack_server.rb", "test/test_thread_pool.rb", "test/test_unix_socket.rb", "test/test_ws.rb"]
|
23
24
|
|
@@ -26,19 +27,19 @@ Gem::Specification.new do |s|
|
|
26
27
|
|
27
28
|
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
28
29
|
s.add_runtime_dependency(%q<rack>, ["~> 1.2"])
|
29
|
-
s.add_development_dependency(%q<rake-compiler>, ["~> 0.8.0"])
|
30
30
|
s.add_development_dependency(%q<rdoc>, ["~> 3.10"])
|
31
|
-
s.add_development_dependency(%q<
|
31
|
+
s.add_development_dependency(%q<rake-compiler>, ["~> 0.8.0"])
|
32
|
+
s.add_development_dependency(%q<hoe>, ["~> 3.0"])
|
32
33
|
else
|
33
34
|
s.add_dependency(%q<rack>, ["~> 1.2"])
|
34
|
-
s.add_dependency(%q<rake-compiler>, ["~> 0.8.0"])
|
35
35
|
s.add_dependency(%q<rdoc>, ["~> 3.10"])
|
36
|
-
s.add_dependency(%q<
|
36
|
+
s.add_dependency(%q<rake-compiler>, ["~> 0.8.0"])
|
37
|
+
s.add_dependency(%q<hoe>, ["~> 3.0"])
|
37
38
|
end
|
38
39
|
else
|
39
40
|
s.add_dependency(%q<rack>, ["~> 1.2"])
|
40
|
-
s.add_dependency(%q<rake-compiler>, ["~> 0.8.0"])
|
41
41
|
s.add_dependency(%q<rdoc>, ["~> 3.10"])
|
42
|
-
s.add_dependency(%q<
|
42
|
+
s.add_dependency(%q<rake-compiler>, ["~> 0.8.0"])
|
43
|
+
s.add_dependency(%q<hoe>, ["~> 3.0"])
|
43
44
|
end
|
44
45
|
end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: puma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.
|
5
|
+
version: 1.2.0
|
6
6
|
platform: java
|
7
7
|
authors:
|
8
8
|
- Evan Phoenix
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-04-11 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rack
|
@@ -142,7 +142,7 @@ files:
|
|
142
142
|
- test/testhelp.rb
|
143
143
|
- tools/trickletest.rb
|
144
144
|
- lib/puma/puma_http11.jar
|
145
|
-
homepage:
|
145
|
+
homepage: http://puma.io
|
146
146
|
licenses: []
|
147
147
|
|
148
148
|
post_install_message:
|