jun-puma 1.0.1-java → 1.0.3-java

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.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/History.md +451 -1870
  3. data/LICENSE +20 -23
  4. data/README.md +65 -226
  5. data/ext/puma_http11/extconf.rb +3 -64
  6. data/lib/puma/puma_http11.jar +0 -0
  7. metadata +9 -105
  8. data/bin/puma-wild +0 -25
  9. data/docs/architecture.md +0 -74
  10. data/docs/compile_options.md +0 -55
  11. data/docs/deployment.md +0 -102
  12. data/docs/fork_worker.md +0 -31
  13. data/docs/images/puma-connection-flow-no-reactor.png +0 -0
  14. data/docs/images/puma-connection-flow.png +0 -0
  15. data/docs/images/puma-general-arch.png +0 -0
  16. data/docs/jungle/README.md +0 -9
  17. data/docs/jungle/rc.d/README.md +0 -74
  18. data/docs/jungle/rc.d/puma +0 -61
  19. data/docs/jungle/rc.d/puma.conf +0 -10
  20. data/docs/kubernetes.md +0 -78
  21. data/docs/nginx.md +0 -80
  22. data/docs/plugins.md +0 -38
  23. data/docs/rails_dev_mode.md +0 -28
  24. data/docs/restart.md +0 -64
  25. data/docs/signals.md +0 -98
  26. data/docs/stats.md +0 -142
  27. data/docs/systemd.md +0 -244
  28. data/docs/testing_benchmarks_local_files.md +0 -150
  29. data/docs/testing_test_rackup_ci_files.md +0 -36
  30. data/ext/puma_http11/PumaHttp11Service.java +0 -17
  31. data/ext/puma_http11/ext_help.h +0 -15
  32. data/ext/puma_http11/http11_parser.c +0 -1057
  33. data/ext/puma_http11/http11_parser.h +0 -65
  34. data/ext/puma_http11/http11_parser.java.rl +0 -145
  35. data/ext/puma_http11/http11_parser.rl +0 -149
  36. data/ext/puma_http11/http11_parser_common.rl +0 -54
  37. data/ext/puma_http11/mini_ssl.c +0 -832
  38. data/ext/puma_http11/no_ssl/PumaHttp11Service.java +0 -15
  39. data/ext/puma_http11/org/jruby/puma/Http11.java +0 -226
  40. data/ext/puma_http11/org/jruby/puma/Http11Parser.java +0 -455
  41. data/ext/puma_http11/org/jruby/puma/MiniSSL.java +0 -508
  42. data/ext/puma_http11/puma_http11.c +0 -492
  43. data/lib/puma/app/status.rb +0 -96
  44. data/lib/puma/binder.rb +0 -501
  45. data/lib/puma/cli.rb +0 -243
  46. data/lib/puma/client.rb +0 -632
  47. data/lib/puma/cluster/worker.rb +0 -182
  48. data/lib/puma/cluster/worker_handle.rb +0 -97
  49. data/lib/puma/cluster.rb +0 -562
  50. data/lib/puma/commonlogger.rb +0 -115
  51. data/lib/puma/configuration.rb +0 -391
  52. data/lib/puma/const.rb +0 -289
  53. data/lib/puma/control_cli.rb +0 -316
  54. data/lib/puma/detect.rb +0 -45
  55. data/lib/puma/dsl.rb +0 -1204
  56. data/lib/puma/error_logger.rb +0 -113
  57. data/lib/puma/events.rb +0 -57
  58. data/lib/puma/io_buffer.rb +0 -46
  59. data/lib/puma/jruby_restart.rb +0 -27
  60. data/lib/puma/json_serialization.rb +0 -96
  61. data/lib/puma/launcher/bundle_pruner.rb +0 -104
  62. data/lib/puma/launcher.rb +0 -484
  63. data/lib/puma/log_writer.rb +0 -147
  64. data/lib/puma/minissl/context_builder.rb +0 -95
  65. data/lib/puma/minissl.rb +0 -458
  66. data/lib/puma/null_io.rb +0 -61
  67. data/lib/puma/plugin/systemd.rb +0 -90
  68. data/lib/puma/plugin/tmp_restart.rb +0 -36
  69. data/lib/puma/plugin.rb +0 -111
  70. data/lib/puma/rack/builder.rb +0 -297
  71. data/lib/puma/rack/urlmap.rb +0 -93
  72. data/lib/puma/rack_default.rb +0 -24
  73. data/lib/puma/reactor.rb +0 -125
  74. data/lib/puma/request.rb +0 -671
  75. data/lib/puma/runner.rb +0 -213
  76. data/lib/puma/sd_notify.rb +0 -149
  77. data/lib/puma/server.rb +0 -664
  78. data/lib/puma/single.rb +0 -69
  79. data/lib/puma/state_file.rb +0 -68
  80. data/lib/puma/thread_pool.rb +0 -434
  81. data/lib/puma/util.rb +0 -141
  82. data/lib/puma.rb +0 -78
  83. data/lib/rack/handler/puma.rb +0 -141
  84. data/tools/Dockerfile +0 -16
  85. data/tools/trickletest.rb +0 -44
data/lib/puma.rb DELETED
@@ -1,78 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Standard libraries
4
- require 'socket'
5
- require 'tempfile'
6
- require 'uri'
7
- require 'stringio'
8
-
9
- require 'thread'
10
-
11
- # use require, see https://github.com/puma/puma/pull/2381
12
- require 'puma/puma_http11'
13
-
14
- require_relative 'puma/detect'
15
- require_relative 'puma/json_serialization'
16
-
17
- module Puma
18
- # when Puma is loaded via `Puma::CLI`, all files are loaded via
19
- # `require_relative`. The below are for non-standard loading
20
- autoload :Const, "#{__dir__}/puma/const"
21
- autoload :Server, "#{__dir__}/puma/server"
22
- autoload :Launcher, "#{__dir__}/puma/launcher"
23
- autoload :LogWriter, "#{__dir__}/puma/log_writer"
24
-
25
- # at present, MiniSSL::Engine is only defined in extension code (puma_http11),
26
- # not in minissl.rb
27
- HAS_SSL = const_defined?(:MiniSSL, false) && MiniSSL.const_defined?(:Engine, false)
28
-
29
- HAS_UNIX_SOCKET = Object.const_defined?(:UNIXSocket) && !IS_WINDOWS
30
-
31
- if HAS_SSL
32
- require_relative 'puma/minissl'
33
- else
34
- module MiniSSL
35
- # this class is defined so that it exists when Puma is compiled
36
- # without ssl support, as Server and Reactor use it in rescue statements.
37
- class SSLError < StandardError ; end
38
- end
39
- end
40
-
41
- def self.ssl?
42
- HAS_SSL
43
- end
44
-
45
- def self.abstract_unix_socket?
46
- @abstract_unix ||=
47
- if HAS_UNIX_SOCKET
48
- begin
49
- ::UNIXServer.new("\0puma.temp.unix").close
50
- true
51
- rescue ArgumentError # darwin
52
- false
53
- end
54
- else
55
- false
56
- end
57
- end
58
-
59
- # @!attribute [rw] stats_object=
60
- def self.stats_object=(val)
61
- @get_stats = val
62
- end
63
-
64
- # @!attribute [rw] stats_object
65
- def self.stats
66
- Puma::JSONSerialization.generate @get_stats.stats
67
- end
68
-
69
- # @!attribute [r] stats_hash
70
- # @version 5.0.0
71
- def self.stats_hash
72
- @get_stats.stats
73
- end
74
-
75
- def self.set_thread_name(name)
76
- Thread.current.name = "puma #{name}"
77
- end
78
- end
@@ -1,141 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # This module is used as an 'include' file in code at bottom of file
4
- module Puma
5
- module RackHandler
6
- DEFAULT_OPTIONS = {
7
- :Verbose => false,
8
- :Silent => false
9
- }
10
-
11
- def config(app, options = {})
12
- require_relative '../../puma'
13
- require_relative '../../puma/configuration'
14
- require_relative '../../puma/log_writer'
15
- require_relative '../../puma/launcher'
16
-
17
- default_options = DEFAULT_OPTIONS.dup
18
-
19
- # Libraries pass in values such as :Port and there is no way to determine
20
- # if it is a default provided by the library or a special value provided
21
- # by the user. A special key `user_supplied_options` can be passed. This
22
- # contains an array of all explicitly defined user options. We then
23
- # know that all other values are defaults
24
- if user_supplied_options = options.delete(:user_supplied_options)
25
- (options.keys - user_supplied_options).each do |k|
26
- default_options[k] = options.delete(k)
27
- end
28
- end
29
-
30
- @events = options[:events] || ::Puma::Events.new
31
-
32
- conf = ::Puma::Configuration.new(options, default_options.merge({events: @events})) do |user_config, file_config, default_config|
33
- if options.delete(:Verbose)
34
- begin
35
- require 'rack/commonlogger' # Rack 1.x
36
- rescue LoadError
37
- require 'rack/common_logger' # Rack 2 and later
38
- end
39
- app = ::Rack::CommonLogger.new(app, STDOUT)
40
- end
41
-
42
- if options[:environment]
43
- user_config.environment options[:environment]
44
- end
45
-
46
- if options[:Threads]
47
- min, max = options.delete(:Threads).split(':', 2)
48
- user_config.threads min, max
49
- end
50
-
51
- if options[:Host] || options[:Port]
52
- host = options[:Host] || default_options[:Host]
53
- port = options[:Port] || default_options[:Port]
54
- self.set_host_port_to_config(host, port, user_config)
55
- end
56
-
57
- if default_options[:Host]
58
- file_config.set_default_host(default_options[:Host])
59
- end
60
- self.set_host_port_to_config(default_options[:Host], default_options[:Port], default_config)
61
-
62
- user_config.app app
63
- end
64
- conf
65
- end
66
-
67
- def run(app, **options)
68
- conf = self.config(app, options)
69
-
70
- log_writer = options.delete(:Silent) ? ::Puma::LogWriter.strings : ::Puma::LogWriter.stdio
71
-
72
- launcher = ::Puma::Launcher.new(conf, :log_writer => log_writer, events: @events)
73
-
74
- yield launcher if block_given?
75
- begin
76
- launcher.run
77
- rescue Interrupt
78
- puts "* Gracefully stopping, waiting for requests to finish"
79
- launcher.stop
80
- puts "* Goodbye!"
81
- end
82
- end
83
-
84
- def valid_options
85
- {
86
- "Host=HOST" => "Hostname to listen on (default: localhost)",
87
- "Port=PORT" => "Port to listen on (default: 8080)",
88
- "Threads=MIN:MAX" => "min:max threads to use (default 0:16)",
89
- "Verbose" => "Don't report each request (default: false)"
90
- }
91
- end
92
-
93
- def set_host_port_to_config(host, port, config)
94
- config.clear_binds! if host || port
95
-
96
- if host && (host[0,1] == '.' || host[0,1] == '/')
97
- config.bind "unix://#{host}"
98
- elsif host && host =~ /^ssl:\/\//
99
- uri = URI.parse(host)
100
- uri.port ||= port || ::Puma::Configuration::DEFAULTS[:tcp_port]
101
- config.bind uri.to_s
102
- else
103
-
104
- if host
105
- port ||= ::Puma::Configuration::DEFAULTS[:tcp_port]
106
- end
107
-
108
- if port
109
- host ||= ::Puma::Configuration::DEFAULTS[:tcp_host]
110
- config.port port, host
111
- end
112
- end
113
- end
114
- end
115
- end
116
-
117
- # rackup was removed in Rack 3, it is now a separate gem
118
- if Object.const_defined? :Rackup
119
- module Rackup
120
- module Handler
121
- module Puma
122
- class << self
123
- include ::Puma::RackHandler
124
- end
125
- end
126
- register :puma, Puma
127
- end
128
- end
129
- else
130
- do_register = Object.const_defined?(:Rack) && Rack.release < '3'
131
- module Rack
132
- module Handler
133
- module Puma
134
- class << self
135
- include ::Puma::RackHandler
136
- end
137
- end
138
- end
139
- end
140
- ::Rack::Handler.register(:puma, ::Rack::Handler::Puma) if do_register
141
- end
data/tools/Dockerfile DELETED
@@ -1,16 +0,0 @@
1
- # Use this Dockerfile to create minimal reproductions of issues
2
-
3
- FROM ruby:3.2
4
-
5
- # throw errors if Gemfile has been modified since Gemfile.lock
6
- RUN bundle config --global frozen 1
7
-
8
- WORKDIR /usr/src/app
9
-
10
- COPY . .
11
-
12
- RUN bundle install
13
- RUN bundle exec rake compile
14
-
15
- EXPOSE 9292
16
- CMD bundle exec bin/puma test/rackup/hello.ru
data/tools/trickletest.rb DELETED
@@ -1,44 +0,0 @@
1
- require 'socket'
2
- require 'stringio'
3
-
4
- def do_test(st, chunk)
5
- s = TCPSocket.new('127.0.0.1',ARGV[0].to_i);
6
- req = StringIO.new(st)
7
- nout = 0
8
- randstop = rand(st.length / 10)
9
- STDERR.puts "stopping after: #{randstop}"
10
-
11
- begin
12
- while data = req.read(chunk)
13
- nout += s.write(data)
14
- s.flush
15
- sleep 0.1
16
- if nout > randstop
17
- STDERR.puts "BANG! after #{nout} bytes."
18
- break
19
- end
20
- end
21
- rescue Object => e
22
- STDERR.puts "ERROR: #{e}"
23
- ensure
24
- s.close
25
- end
26
- end
27
-
28
- content = "-" * (1024 * 240)
29
- st = "GET / HTTP/1.1\r\nHost: www.zedshaw.com\r\nContent-Type: text/plain\r\nContent-Length: #{content.length}\r\n\r\n#{content}"
30
-
31
- puts "length: #{content.length}"
32
-
33
- threads = []
34
- ARGV[1].to_i.times do
35
- t = Thread.new do
36
- size = 100
37
- puts ">>>> #{size} sized chunks"
38
- do_test(st, size)
39
- end
40
-
41
- threads << t
42
- end
43
-
44
- threads.each {|t| t.join}