twirbet 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.rspec +3 -0
- data/.rubocop.yml +20 -0
- data/CHANGELOG.md +5 -0
- data/Gemfile +28 -0
- data/Gemfile.lock +127 -0
- data/LICENSE.txt +21 -0
- data/README.md +144 -0
- data/Rakefile +17 -0
- data/examples/clientcompat/client +28 -0
- data/examples/clientcompat/clientcompat.proto +29 -0
- data/examples/clientcompat/clientcompat_pb.rb +36 -0
- data/examples/clientcompat/clientcompat_twirbet.rb +57 -0
- data/examples/ping/Gemfile +11 -0
- data/examples/ping/Gemfile.lock +69 -0
- data/examples/ping/bin/puma +27 -0
- data/examples/ping/bin/pumactl +27 -0
- data/examples/ping/bin/srb +27 -0
- data/examples/ping/bin/srb-rbi +27 -0
- data/examples/ping/bin/tapioca +27 -0
- data/examples/ping/client.rb +14 -0
- data/examples/ping/config/application.rb +13 -0
- data/examples/ping/config/environment.rb +6 -0
- data/examples/ping/config.ru +8 -0
- data/examples/ping/proto/ping.proto +15 -0
- data/examples/ping/proto/ping_pb.rb +20 -0
- data/examples/ping/proto/ping_twirbet.rb +47 -0
- data/examples/ping/sorbet/config +4 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/descriptor_proto/extension_range.rbi +34 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/descriptor_proto/reserved_range.rbi +22 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/descriptor_proto.rbi +83 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/enum_descriptor_proto/enum_reserved_range.rbi +22 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/enum_descriptor_proto.rbi +48 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/enum_options.rbi +34 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/enum_value_descriptor_proto.rbi +34 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/enum_value_options.rbi +27 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/extension_range_options.rbi +20 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/field_descriptor_proto/label.rbi +22 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/field_descriptor_proto/type.rbi +37 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/field_descriptor_proto.rbi +90 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/field_options/c_type.rbi +22 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/field_options/js_type.rbi +22 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/field_options.rbi +69 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/file_descriptor_proto.rbi +97 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/file_descriptor_set.rbi +20 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/file_options/optimize_mode.rbi +22 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/file_options.rbi +160 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/generated_code_info/annotation.rbi +41 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/generated_code_info.rbi +20 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/map.rbi +12 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/message_options.rbi +48 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/method_descriptor_proto.rbi +55 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/method_options/idempotency_level.rbi +22 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/method_options.rbi +34 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/oneof_descriptor_proto.rbi +22 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/oneof_options.rbi +20 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/repeated_field.rbi +11 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/service_descriptor_proto.rbi +34 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/service_options.rbi +27 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/source_code_info/location.rbi +48 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/source_code_info.rbi +20 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/uninterpreted_option/name_part.rbi +22 -0
- data/examples/ping/sorbet/rbi/dsl/google/protobuf/uninterpreted_option.rbi +62 -0
- data/examples/ping/sorbet/rbi/dsl/ping/ping_request.rbi +16 -0
- data/examples/ping/sorbet/rbi/dsl/ping/ping_response.rbi +16 -0
- data/examples/ping/sorbet/rbi/gems/ast@2.4.2.rbi +584 -0
- data/examples/ping/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +8 -0
- data/examples/ping/sorbet/rbi/gems/google-protobuf@3.21.12.rbi +1645 -0
- data/examples/ping/sorbet/rbi/gems/netrc@0.11.0.rbi +158 -0
- data/examples/ping/sorbet/rbi/gems/nio4r@2.5.8.rbi +8 -0
- data/examples/ping/sorbet/rbi/gems/parallel@1.22.1.rbi +277 -0
- data/examples/ping/sorbet/rbi/gems/parser@3.1.3.0.rbi +5076 -0
- data/examples/ping/sorbet/rbi/gems/puma@6.0.0.rbi +4177 -0
- data/examples/ping/sorbet/rbi/gems/rack@3.0.2.rbi +5016 -0
- data/examples/ping/sorbet/rbi/gems/rbi@0.0.16.rbi +3008 -0
- data/examples/ping/sorbet/rbi/gems/spoom@1.1.15.rbi +2383 -0
- data/examples/ping/sorbet/rbi/gems/tapioca@0.10.3.rbi +3032 -0
- data/examples/ping/sorbet/rbi/gems/thor@1.2.1.rbi +3919 -0
- data/examples/ping/sorbet/rbi/gems/twirbet@0.1.0.rbi +528 -0
- data/examples/ping/sorbet/rbi/gems/unparser@0.6.5.rbi +8 -0
- data/examples/ping/sorbet/rbi/gems/webrick@1.7.0.rbi +2498 -0
- data/examples/ping/sorbet/rbi/gems/yard-sorbet@0.7.0.rbi +391 -0
- data/examples/ping/sorbet/rbi/gems/yard@0.9.28.rbi +17022 -0
- data/examples/ping/sorbet/tapioca/config.yml +13 -0
- data/examples/ping/sorbet/tapioca/require.rb +5 -0
- data/lib/twirbet/client.rb +45 -0
- data/lib/twirbet/dsl.rb +84 -0
- data/lib/twirbet/encoding.rb +52 -0
- data/lib/twirbet/errors.rb +375 -0
- data/lib/twirbet/method.rb +34 -0
- data/lib/twirbet/service.rb +85 -0
- data/lib/twirbet/transport.rb +55 -0
- data/lib/twirbet/transports/fake_transport.rb +32 -0
- data/lib/twirbet/transports/net_http_transport.rb +20 -0
- data/lib/twirbet/version.rb +6 -0
- data/lib/twirbet.rb +11 -0
- data/sorbet/config +5 -0
- data/sorbet/rbi/annotations/rainbow.rbi +269 -0
- data/sorbet/rbi/custom/ping.rbi +23 -0
- data/sorbet/rbi/gems/ast@2.4.2.rbi +584 -0
- data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +1064 -0
- data/sorbet/rbi/gems/google-protobuf@3.21.12.rbi +1645 -0
- data/sorbet/rbi/gems/json@2.6.3.rbi +1541 -0
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +158 -0
- data/sorbet/rbi/gems/parallel@1.22.1.rbi +277 -0
- data/sorbet/rbi/gems/parser@3.1.3.0.rbi +6878 -0
- data/sorbet/rbi/gems/rack@3.0.2.rbi +5163 -0
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +397 -0
- data/sorbet/rbi/gems/rake@13.0.6.rbi +2946 -0
- data/sorbet/rbi/gems/rbi@0.0.16.rbi +3008 -0
- data/sorbet/rbi/gems/regexp_parser@2.6.1.rbi +3126 -0
- data/sorbet/rbi/gems/rexml@3.2.5.rbi +4660 -0
- data/sorbet/rbi/gems/rspec-core@3.12.0.rbi +10492 -0
- data/sorbet/rbi/gems/rspec-expectations@3.12.1.rbi +7817 -0
- data/sorbet/rbi/gems/rspec-mocks@3.12.1.rbi +4994 -0
- data/sorbet/rbi/gems/rspec-support@3.12.0.rbi +1477 -0
- data/sorbet/rbi/gems/rspec@3.12.0.rbi +10 -0
- data/sorbet/rbi/gems/rubocop-ast@1.24.0.rbi +6790 -0
- data/sorbet/rbi/gems/rubocop-rake@0.6.0.rbi +354 -0
- data/sorbet/rbi/gems/rubocop-rspec@2.16.0.rbi +7650 -0
- data/sorbet/rbi/gems/rubocop-shopify@2.10.1.rbi +8 -0
- data/sorbet/rbi/gems/rubocop-sorbet@0.6.11.rbi +1014 -0
- data/sorbet/rbi/gems/rubocop@1.40.0.rbi +51560 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi +1212 -0
- data/sorbet/rbi/gems/spoom@1.1.15.rbi +2383 -0
- data/sorbet/rbi/gems/tapioca@0.10.3.rbi +3032 -0
- data/sorbet/rbi/gems/thor@1.2.1.rbi +3950 -0
- data/sorbet/rbi/gems/unicode-display_width@2.3.0.rbi +46 -0
- data/sorbet/rbi/gems/unparser@0.6.5.rbi +4265 -0
- data/sorbet/rbi/gems/webrick@1.7.0.rbi +2498 -0
- data/sorbet/rbi/gems/yard-sorbet@0.7.0.rbi +391 -0
- data/sorbet/rbi/gems/yard@0.9.28.rbi +17033 -0
- data/sorbet/tapioca/config.yml +13 -0
- data/sorbet/tapioca/require.rb +4 -0
- data/twirbet.gemspec +36 -0
- metadata +223 -0
@@ -0,0 +1,4177 @@
|
|
1
|
+
# typed: true
|
2
|
+
|
3
|
+
# DO NOT EDIT MANUALLY
|
4
|
+
# This is an autogenerated file for types exported from the `puma` gem.
|
5
|
+
# Please instead update this file by running `bin/tapioca gem puma`.
|
6
|
+
|
7
|
+
# note that dsl is loaded at end of file, requires ConfigDefault constants
|
8
|
+
module Puma
|
9
|
+
class << self
|
10
|
+
# @return [Boolean]
|
11
|
+
#
|
12
|
+
# source://puma//lib/puma.rb#47
|
13
|
+
def abstract_unix_socket?; end
|
14
|
+
|
15
|
+
# @return [Boolean]
|
16
|
+
# @version 5.0.0
|
17
|
+
#
|
18
|
+
# source://puma//lib/puma/detect.rb#41
|
19
|
+
def forkable?; end
|
20
|
+
|
21
|
+
# @return [Boolean]
|
22
|
+
#
|
23
|
+
# source://puma//lib/puma/detect.rb#23
|
24
|
+
def jruby?; end
|
25
|
+
|
26
|
+
# @return [Boolean]
|
27
|
+
# @version 5.0.0
|
28
|
+
#
|
29
|
+
# source://puma//lib/puma/detect.rb#36
|
30
|
+
def mri?; end
|
31
|
+
|
32
|
+
# @return [Boolean]
|
33
|
+
#
|
34
|
+
# source://puma//lib/puma/detect.rb#27
|
35
|
+
def osx?; end
|
36
|
+
|
37
|
+
# source://puma//lib/puma.rb#77
|
38
|
+
def set_thread_name(name); end
|
39
|
+
|
40
|
+
# @return [Boolean]
|
41
|
+
#
|
42
|
+
# source://puma//lib/puma.rb#43
|
43
|
+
def ssl?; end
|
44
|
+
|
45
|
+
# source://puma//lib/puma.rb#67
|
46
|
+
def stats; end
|
47
|
+
|
48
|
+
# @version 5.0.0
|
49
|
+
#
|
50
|
+
# source://puma//lib/puma.rb#73
|
51
|
+
def stats_hash; end
|
52
|
+
|
53
|
+
# source://puma//lib/puma.rb#62
|
54
|
+
def stats_object=(val); end
|
55
|
+
|
56
|
+
# @return [Boolean]
|
57
|
+
#
|
58
|
+
# source://puma//lib/puma/detect.rb#31
|
59
|
+
def windows?; end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
class Puma::Binder
|
64
|
+
include ::Puma::Const
|
65
|
+
|
66
|
+
# @return [Binder] a new instance of Binder
|
67
|
+
#
|
68
|
+
# source://puma//lib/puma/binder.rb#22
|
69
|
+
def initialize(log_writer, conf = T.unsafe(nil)); end
|
70
|
+
|
71
|
+
# @version 5.0.0
|
72
|
+
#
|
73
|
+
# source://puma//lib/puma/binder.rb#57
|
74
|
+
def activated_sockets; end
|
75
|
+
|
76
|
+
# source://puma//lib/puma/binder.rb#353
|
77
|
+
def add_ssl_listener(host, port, ctx, optimize_for_latency = T.unsafe(nil), backlog = T.unsafe(nil)); end
|
78
|
+
|
79
|
+
# Tell the server to listen on host +host+, port +port+.
|
80
|
+
# If +optimize_for_latency+ is true (the default) then clients connecting
|
81
|
+
# will be optimized for latency over throughput.
|
82
|
+
#
|
83
|
+
# +backlog+ indicates how many unaccepted connections the kernel should
|
84
|
+
# allow to accumulate before returning connection refused.
|
85
|
+
#
|
86
|
+
# source://puma//lib/puma/binder.rb#325
|
87
|
+
def add_tcp_listener(host, port, optimize_for_latency = T.unsafe(nil), backlog = T.unsafe(nil)); end
|
88
|
+
|
89
|
+
# Tell the server to listen on +path+ as a UNIX domain socket.
|
90
|
+
#
|
91
|
+
# source://puma//lib/puma/binder.rb#404
|
92
|
+
def add_unix_listener(path, umask = T.unsafe(nil), mode = T.unsafe(nil), backlog = T.unsafe(nil)); end
|
93
|
+
|
94
|
+
# source://puma//lib/puma/binder.rb#66
|
95
|
+
def close; end
|
96
|
+
|
97
|
+
# source://puma//lib/puma/binder.rb#451
|
98
|
+
def close_listeners; end
|
99
|
+
|
100
|
+
# @version 5.0.0
|
101
|
+
#
|
102
|
+
# source://puma//lib/puma/binder.rb#72
|
103
|
+
def connected_ports; end
|
104
|
+
|
105
|
+
# systemd socket activation.
|
106
|
+
# LISTEN_FDS = number of listening sockets. e.g. 2 means accept on 2 sockets w/descriptors 3 and 4.
|
107
|
+
# LISTEN_PID = PID of the service process, aka us
|
108
|
+
#
|
109
|
+
# @see https://www.freedesktop.org/software/systemd/man/systemd-socket-activate.html
|
110
|
+
# @version 5.0.0
|
111
|
+
#
|
112
|
+
# source://puma//lib/puma/binder.rb#90
|
113
|
+
def create_activated_fds(env_hash); end
|
114
|
+
|
115
|
+
# @version 5.0.0
|
116
|
+
#
|
117
|
+
# source://puma//lib/puma/binder.rb#77
|
118
|
+
def create_inherited_fds(env_hash); end
|
119
|
+
|
120
|
+
# source://puma//lib/puma/binder.rb#62
|
121
|
+
def env(sock); end
|
122
|
+
|
123
|
+
# @version 5.0.0
|
124
|
+
#
|
125
|
+
# source://puma//lib/puma/binder.rb#57
|
126
|
+
def envs; end
|
127
|
+
|
128
|
+
# source://puma//lib/puma/binder.rb#384
|
129
|
+
def inherit_ssl_listener(fd, ctx); end
|
130
|
+
|
131
|
+
# source://puma//lib/puma/binder.rb#346
|
132
|
+
def inherit_tcp_listener(host, port, fd); end
|
133
|
+
|
134
|
+
# source://puma//lib/puma/binder.rb#439
|
135
|
+
def inherit_unix_listener(path, fd); end
|
136
|
+
|
137
|
+
# @version 5.0.0
|
138
|
+
#
|
139
|
+
# source://puma//lib/puma/binder.rb#57
|
140
|
+
def inherited_fds; end
|
141
|
+
|
142
|
+
# Returns the value of attribute ios.
|
143
|
+
#
|
144
|
+
# source://puma//lib/puma/binder.rb#54
|
145
|
+
def ios; end
|
146
|
+
|
147
|
+
# @version 5.0.0
|
148
|
+
#
|
149
|
+
# source://puma//lib/puma/binder.rb#60
|
150
|
+
def ios=(_arg0); end
|
151
|
+
|
152
|
+
# @version 5.0.0
|
153
|
+
#
|
154
|
+
# source://puma//lib/puma/binder.rb#57
|
155
|
+
def listeners; end
|
156
|
+
|
157
|
+
# @version 5.0.0
|
158
|
+
#
|
159
|
+
# source://puma//lib/puma/binder.rb#60
|
160
|
+
def listeners=(_arg0); end
|
161
|
+
|
162
|
+
# source://puma//lib/puma/binder.rb#302
|
163
|
+
def localhost_authority; end
|
164
|
+
|
165
|
+
# source://puma//lib/puma/binder.rb#306
|
166
|
+
def localhost_authority_context; end
|
167
|
+
|
168
|
+
# source://puma//lib/puma/binder.rb#145
|
169
|
+
def parse(binds, log_writer = T.unsafe(nil), log_msg = T.unsafe(nil)); end
|
170
|
+
|
171
|
+
# @version 5.0.0
|
172
|
+
#
|
173
|
+
# source://puma//lib/puma/binder.rb#57
|
174
|
+
def proto_env; end
|
175
|
+
|
176
|
+
# source://puma//lib/puma/binder.rb#461
|
177
|
+
def redirects_for_restart; end
|
178
|
+
|
179
|
+
# @version 5.0.0
|
180
|
+
#
|
181
|
+
# source://puma//lib/puma/binder.rb#468
|
182
|
+
def redirects_for_restart_env; end
|
183
|
+
|
184
|
+
# Synthesize binds from systemd socket activation
|
185
|
+
#
|
186
|
+
# When systemd socket activation is enabled, it can be tedious to keep the
|
187
|
+
# binds in sync. This method can synthesize any binds based on the received
|
188
|
+
# activated sockets. Any existing matching binds will be respected.
|
189
|
+
#
|
190
|
+
# When only_matching is true in, all binds that do not match an activated
|
191
|
+
# socket is removed in place.
|
192
|
+
#
|
193
|
+
# It's a noop if no activated sockets were received.
|
194
|
+
#
|
195
|
+
# source://puma//lib/puma/binder.rb#118
|
196
|
+
def synthesize_binds_from_activated_fs(binds, only_matching); end
|
197
|
+
|
198
|
+
# @version 5.0.0
|
199
|
+
#
|
200
|
+
# source://puma//lib/puma/binder.rb#57
|
201
|
+
def unix_paths; end
|
202
|
+
|
203
|
+
private
|
204
|
+
|
205
|
+
# source://puma//lib/puma/binder.rb#484
|
206
|
+
def loc_addr_str(io); end
|
207
|
+
|
208
|
+
# source://puma//lib/puma/binder.rb#477
|
209
|
+
def loopback_addresses; end
|
210
|
+
|
211
|
+
# @version 5.0.0
|
212
|
+
#
|
213
|
+
# source://puma//lib/puma/binder.rb#494
|
214
|
+
def socket_activation_fd(int); end
|
215
|
+
end
|
216
|
+
|
217
|
+
# source://puma//lib/puma/binder.rb#20
|
218
|
+
Puma::Binder::RACK_VERSION = T.let(T.unsafe(nil), Array)
|
219
|
+
|
220
|
+
# An instance of this class represents a unique request from a client.
|
221
|
+
# For example, this could be a web request from a browser or from CURL.
|
222
|
+
#
|
223
|
+
# An instance of `Puma::Client` can be used as if it were an IO object
|
224
|
+
# by the reactor. The reactor is expected to call `#to_io`
|
225
|
+
# on any non-IO objects it polls. For example, nio4r internally calls
|
226
|
+
# `IO::try_convert` (which may call `#to_io`) when a new socket is
|
227
|
+
# registered.
|
228
|
+
#
|
229
|
+
# Instances of this class are responsible for knowing if
|
230
|
+
# the header and body are fully buffered via the `try_to_finish` method.
|
231
|
+
# They can be used to "time out" a response via the `timeout_at` reader.
|
232
|
+
class Puma::Client
|
233
|
+
include ::Puma::Const
|
234
|
+
extend ::Forwardable
|
235
|
+
|
236
|
+
# @return [Client] a new instance of Client
|
237
|
+
#
|
238
|
+
# source://puma//lib/puma/client.rb#65
|
239
|
+
def initialize(io, env = T.unsafe(nil)); end
|
240
|
+
|
241
|
+
# Returns the value of attribute body.
|
242
|
+
#
|
243
|
+
# source://puma//lib/puma/client.rb#98
|
244
|
+
def body; end
|
245
|
+
|
246
|
+
# For the hijack protocol (allows us to just put the Client object
|
247
|
+
# into the env)
|
248
|
+
#
|
249
|
+
# source://puma//lib/puma/client.rb#120
|
250
|
+
def call; end
|
251
|
+
|
252
|
+
# Returns true if the persistent connection can be closed immediately
|
253
|
+
# without waiting for the configured idle/shutdown timeout.
|
254
|
+
#
|
255
|
+
# @return [Boolean]
|
256
|
+
# @version 5.0.0
|
257
|
+
#
|
258
|
+
# source://puma//lib/puma/client.rb#298
|
259
|
+
def can_close?; end
|
260
|
+
|
261
|
+
# source://puma//lib/puma/client.rb#177
|
262
|
+
def close; end
|
263
|
+
|
264
|
+
# source://forwardable/1.3.2/forwardable.rb#229
|
265
|
+
def closed?(*args, **_arg1, &block); end
|
266
|
+
|
267
|
+
# source://puma//lib/puma/client.rb#249
|
268
|
+
def eagerly_finish; end
|
269
|
+
|
270
|
+
# Returns the value of attribute env.
|
271
|
+
#
|
272
|
+
# source://puma//lib/puma/client.rb#98
|
273
|
+
def env; end
|
274
|
+
|
275
|
+
# source://puma//lib/puma/client.rb#303
|
276
|
+
def expect_proxy_proto=(val); end
|
277
|
+
|
278
|
+
# source://puma//lib/puma/client.rb#255
|
279
|
+
def finish(timeout); end
|
280
|
+
|
281
|
+
# Returns the value of attribute hijacked.
|
282
|
+
#
|
283
|
+
# source://puma//lib/puma/client.rb#98
|
284
|
+
def hijacked; end
|
285
|
+
|
286
|
+
# source://puma//lib/puma/client.rb#126
|
287
|
+
def in_data_phase; end
|
288
|
+
|
289
|
+
# source://puma//lib/puma/client.rb#114
|
290
|
+
def inspect; end
|
291
|
+
|
292
|
+
# Returns the value of attribute io.
|
293
|
+
#
|
294
|
+
# source://puma//lib/puma/client.rb#98
|
295
|
+
def io; end
|
296
|
+
|
297
|
+
# Test to see if io meets a bare minimum of functioning, @to_io needs to be
|
298
|
+
# used for MiniSSL::Socket
|
299
|
+
#
|
300
|
+
# @return [Boolean]
|
301
|
+
#
|
302
|
+
# source://puma//lib/puma/client.rb#109
|
303
|
+
def io_ok?; end
|
304
|
+
|
305
|
+
# Returns the value of attribute listener.
|
306
|
+
#
|
307
|
+
# source://puma//lib/puma/client.rb#103
|
308
|
+
def listener; end
|
309
|
+
|
310
|
+
# Sets the attribute listener
|
311
|
+
#
|
312
|
+
# @param value the value to set the attribute listener to.
|
313
|
+
#
|
314
|
+
# source://puma//lib/puma/client.rb#103
|
315
|
+
def listener=(_arg0); end
|
316
|
+
|
317
|
+
# source://puma//lib/puma/client.rb#284
|
318
|
+
def peer_family; end
|
319
|
+
|
320
|
+
# source://puma//lib/puma/client.rb#272
|
321
|
+
def peerip; end
|
322
|
+
|
323
|
+
# Sets the attribute peerip
|
324
|
+
#
|
325
|
+
# @param value the value to set the attribute peerip to.
|
326
|
+
#
|
327
|
+
# source://puma//lib/puma/client.rb#101
|
328
|
+
def peerip=(_arg0); end
|
329
|
+
|
330
|
+
# Returns the value of attribute ready.
|
331
|
+
#
|
332
|
+
# source://puma//lib/puma/client.rb#98
|
333
|
+
def ready; end
|
334
|
+
|
335
|
+
# Returns the value of attribute remote_addr_header.
|
336
|
+
#
|
337
|
+
# source://puma//lib/puma/client.rb#103
|
338
|
+
def remote_addr_header; end
|
339
|
+
|
340
|
+
# Sets the attribute remote_addr_header
|
341
|
+
#
|
342
|
+
# @param value the value to set the attribute remote_addr_header to.
|
343
|
+
#
|
344
|
+
# source://puma//lib/puma/client.rb#103
|
345
|
+
def remote_addr_header=(_arg0); end
|
346
|
+
|
347
|
+
# source://puma//lib/puma/client.rb#139
|
348
|
+
def reset(fast_check = T.unsafe(nil)); end
|
349
|
+
|
350
|
+
# source://puma//lib/puma/client.rb#130
|
351
|
+
def set_timeout(val); end
|
352
|
+
|
353
|
+
# Returns the value of attribute tempfile.
|
354
|
+
#
|
355
|
+
# source://puma//lib/puma/client.rb#98
|
356
|
+
def tempfile; end
|
357
|
+
|
358
|
+
# Number of seconds until the timeout elapses.
|
359
|
+
#
|
360
|
+
# source://puma//lib/puma/client.rb#135
|
361
|
+
def timeout; end
|
362
|
+
|
363
|
+
# @raise [ConnectionError]
|
364
|
+
#
|
365
|
+
# source://puma//lib/puma/client.rb#260
|
366
|
+
def timeout!; end
|
367
|
+
|
368
|
+
# Returns the value of attribute timeout_at.
|
369
|
+
#
|
370
|
+
# source://puma//lib/puma/client.rb#98
|
371
|
+
def timeout_at; end
|
372
|
+
|
373
|
+
# Returns the value of attribute to_io.
|
374
|
+
#
|
375
|
+
# source://puma//lib/puma/client.rb#98
|
376
|
+
def to_io; end
|
377
|
+
|
378
|
+
# source://puma//lib/puma/client.rb#209
|
379
|
+
def try_to_finish; end
|
380
|
+
|
381
|
+
# If necessary, read the PROXY protocol from the buffer. Returns
|
382
|
+
# false if more data is needed.
|
383
|
+
#
|
384
|
+
# source://puma//lib/puma/client.rb#187
|
385
|
+
def try_to_parse_proxy_protocol; end
|
386
|
+
|
387
|
+
# source://puma//lib/puma/client.rb#265
|
388
|
+
def write_error(status_code); end
|
389
|
+
|
390
|
+
private
|
391
|
+
|
392
|
+
# source://puma//lib/puma/client.rb#490
|
393
|
+
def decode_chunk(chunk); end
|
394
|
+
|
395
|
+
# source://puma//lib/puma/client.rb#398
|
396
|
+
def read_body; end
|
397
|
+
|
398
|
+
# source://puma//lib/puma/client.rb#443
|
399
|
+
def read_chunked_body; end
|
400
|
+
|
401
|
+
# source://puma//lib/puma/client.rb#587
|
402
|
+
def set_ready; end
|
403
|
+
|
404
|
+
# source://puma//lib/puma/client.rb#316
|
405
|
+
def setup_body; end
|
406
|
+
|
407
|
+
# source://puma//lib/puma/client.rb#468
|
408
|
+
def setup_chunked_body(body); end
|
409
|
+
|
410
|
+
# @version 5.0.0
|
411
|
+
#
|
412
|
+
# source://puma//lib/puma/client.rb#486
|
413
|
+
def write_chunk(str); end
|
414
|
+
end
|
415
|
+
|
416
|
+
# this tests all values but the last, which must be chunked
|
417
|
+
#
|
418
|
+
# source://puma//lib/puma/client.rb#47
|
419
|
+
Puma::Client::ALLOWED_TRANSFER_ENCODING = T.let(T.unsafe(nil), Array)
|
420
|
+
|
421
|
+
# chunked body validation
|
422
|
+
#
|
423
|
+
# source://puma//lib/puma/client.rb#50
|
424
|
+
Puma::Client::CHUNK_SIZE_INVALID = T.let(T.unsafe(nil), Regexp)
|
425
|
+
|
426
|
+
# source://puma//lib/puma/client.rb#51
|
427
|
+
Puma::Client::CHUNK_VALID_ENDING = T.let(T.unsafe(nil), String)
|
428
|
+
|
429
|
+
# Content-Length header value validation
|
430
|
+
#
|
431
|
+
# source://puma//lib/puma/client.rb#54
|
432
|
+
Puma::Client::CONTENT_LENGTH_VALUE_INVALID = T.let(T.unsafe(nil), Regexp)
|
433
|
+
|
434
|
+
# The object used for a request with no body. All requests with
|
435
|
+
# no body share this one object since it has no state.
|
436
|
+
#
|
437
|
+
# source://puma//lib/puma/client.rb#60
|
438
|
+
Puma::Client::EmptyBody = T.let(T.unsafe(nil), Puma::NullIO)
|
439
|
+
|
440
|
+
# source://puma//lib/puma/client.rb#56
|
441
|
+
Puma::Client::TE_ERR_MSG = T.let(T.unsafe(nil), String)
|
442
|
+
|
443
|
+
# This class is instantiated by the `Puma::Launcher` and used
|
444
|
+
# to boot and serve a Ruby application when puma "workers" are needed
|
445
|
+
# i.e. when using multi-processes. For example `$ puma -w 5`
|
446
|
+
#
|
447
|
+
# An instance of this class will spawn the number of processes passed in
|
448
|
+
# via the `spawn_workers` method call. Each worker will have it's own
|
449
|
+
# instance of a `Puma::Server`.
|
450
|
+
class Puma::Cluster < ::Puma::Runner
|
451
|
+
# @return [Cluster] a new instance of Cluster
|
452
|
+
#
|
453
|
+
# source://puma//lib/puma/cluster.rb#20
|
454
|
+
def initialize(launcher); end
|
455
|
+
|
456
|
+
# @return [Boolean]
|
457
|
+
#
|
458
|
+
# source://puma//lib/puma/cluster.rb#153
|
459
|
+
def all_workers_booted?; end
|
460
|
+
|
461
|
+
# source://puma//lib/puma/cluster.rb#157
|
462
|
+
def check_workers; end
|
463
|
+
|
464
|
+
# source://puma//lib/puma/cluster.rb#136
|
465
|
+
def cull_start_index(diff); end
|
466
|
+
|
467
|
+
# source://puma//lib/puma/cluster.rb#112
|
468
|
+
def cull_workers; end
|
469
|
+
|
470
|
+
# @version 5.0.0
|
471
|
+
#
|
472
|
+
# source://puma//lib/puma/cluster.rb#280
|
473
|
+
def fork_worker!; end
|
474
|
+
|
475
|
+
# source://puma//lib/puma/cluster.rb#237
|
476
|
+
def halt; end
|
477
|
+
|
478
|
+
# source://puma//lib/puma/cluster.rb#146
|
479
|
+
def next_worker_index; end
|
480
|
+
|
481
|
+
# source://puma//lib/puma/cluster.rb#216
|
482
|
+
def phased_restart(refork = T.unsafe(nil)); end
|
483
|
+
|
484
|
+
# @return [Boolean]
|
485
|
+
#
|
486
|
+
# source://puma//lib/puma/cluster.rb#275
|
487
|
+
def preload?; end
|
488
|
+
|
489
|
+
# source://puma//lib/puma/cluster.rb#61
|
490
|
+
def redirect_io; end
|
491
|
+
|
492
|
+
# source://puma//lib/puma/cluster.rb#242
|
493
|
+
def reload_worker_directory; end
|
494
|
+
|
495
|
+
# source://puma//lib/puma/cluster.rb#211
|
496
|
+
def restart; end
|
497
|
+
|
498
|
+
# source://puma//lib/puma/cluster.rb#340
|
499
|
+
def run; end
|
500
|
+
|
501
|
+
# We do this in a separate method to keep the lambda scope
|
502
|
+
# of the signals handlers as small as possible.
|
503
|
+
#
|
504
|
+
# source://puma//lib/puma/cluster.rb#289
|
505
|
+
def setup_signals; end
|
506
|
+
|
507
|
+
# @version 5.0.0
|
508
|
+
#
|
509
|
+
# source://puma//lib/puma/cluster.rb#98
|
510
|
+
def spawn_worker(idx, master); end
|
511
|
+
|
512
|
+
# source://puma//lib/puma/cluster.rb#67
|
513
|
+
def spawn_workers; end
|
514
|
+
|
515
|
+
# source://puma//lib/puma/cluster.rb#49
|
516
|
+
def start_phased_restart; end
|
517
|
+
|
518
|
+
# Inside of a child process, this will return all zeroes, as @workers is only populated in
|
519
|
+
# the master process.
|
520
|
+
#
|
521
|
+
# source://puma//lib/puma/cluster.rb#251
|
522
|
+
def stats; end
|
523
|
+
|
524
|
+
# source://puma//lib/puma/cluster.rb#225
|
525
|
+
def stop; end
|
526
|
+
|
527
|
+
# source://puma//lib/puma/cluster.rb#230
|
528
|
+
def stop_blocked; end
|
529
|
+
|
530
|
+
# source://puma//lib/puma/cluster.rb#34
|
531
|
+
def stop_workers; end
|
532
|
+
|
533
|
+
# source://puma//lib/puma/cluster.rb#189
|
534
|
+
def worker(index, master); end
|
535
|
+
|
536
|
+
# Returns the list of cluster worker handles.
|
537
|
+
#
|
538
|
+
# @return [Array<Puma::Cluster::WorkerHandle>]
|
539
|
+
#
|
540
|
+
# source://puma//lib/puma/cluster.rb#32
|
541
|
+
def workers; end
|
542
|
+
|
543
|
+
# source://puma//lib/puma/cluster.rb#126
|
544
|
+
def workers_to_cull(diff); end
|
545
|
+
|
546
|
+
private
|
547
|
+
|
548
|
+
# source://puma//lib/puma/cluster.rb#500
|
549
|
+
def single_worker_warning; end
|
550
|
+
|
551
|
+
# @version 5.0.0
|
552
|
+
#
|
553
|
+
# source://puma//lib/puma/cluster.rb#535
|
554
|
+
def timeout_workers; end
|
555
|
+
|
556
|
+
# loops thru @workers, removing workers that exited, and calling
|
557
|
+
# `#term` if needed
|
558
|
+
#
|
559
|
+
# source://puma//lib/puma/cluster.rb#511
|
560
|
+
def wait_workers; end
|
561
|
+
end
|
562
|
+
|
563
|
+
# This class is instantiated by the `Puma::Cluster` and represents a single
|
564
|
+
# worker process.
|
565
|
+
#
|
566
|
+
# At the core of this class is running an instance of `Puma::Server` which
|
567
|
+
# gets created via the `start_server` method from the `Puma::Runner` class
|
568
|
+
# that this inherits from.
|
569
|
+
class Puma::Cluster::Worker < ::Puma::Runner
|
570
|
+
# @return [Worker] a new instance of Worker
|
571
|
+
#
|
572
|
+
# source://puma//lib/puma/cluster/worker.rb#17
|
573
|
+
def initialize(index:, master:, launcher:, pipes:, server: T.unsafe(nil)); end
|
574
|
+
|
575
|
+
# source://puma//lib/puma/cluster/worker.rb#15
|
576
|
+
def index; end
|
577
|
+
|
578
|
+
# source://puma//lib/puma/cluster/worker.rb#15
|
579
|
+
def master; end
|
580
|
+
|
581
|
+
# source://puma//lib/puma/cluster/worker.rb#30
|
582
|
+
def run; end
|
583
|
+
|
584
|
+
private
|
585
|
+
|
586
|
+
# source://puma//lib/puma/cluster/worker.rb#151
|
587
|
+
def spawn_worker(idx); end
|
588
|
+
end
|
589
|
+
|
590
|
+
# This class represents a worker process from the perspective of the puma
|
591
|
+
# master process. It contains information about the process and its health
|
592
|
+
# and it exposes methods to control the process via IPC. It does not
|
593
|
+
# include the actual logic executed by the worker process itself. For that,
|
594
|
+
# see Puma::Cluster::Worker.
|
595
|
+
class Puma::Cluster::WorkerHandle
|
596
|
+
# @return [WorkerHandle] a new instance of WorkerHandle
|
597
|
+
#
|
598
|
+
# source://puma//lib/puma/cluster/worker_handle.rb#14
|
599
|
+
def initialize(idx, pid, phase, options); end
|
600
|
+
|
601
|
+
# source://puma//lib/puma/cluster/worker_handle.rb#41
|
602
|
+
def boot!; end
|
603
|
+
|
604
|
+
# @return [Boolean]
|
605
|
+
#
|
606
|
+
# source://puma//lib/puma/cluster/worker_handle.rb#33
|
607
|
+
def booted?; end
|
608
|
+
|
609
|
+
# source://puma//lib/puma/cluster/worker_handle.rb#91
|
610
|
+
def hup; end
|
611
|
+
|
612
|
+
# Returns the value of attribute index.
|
613
|
+
#
|
614
|
+
# source://puma//lib/puma/cluster/worker_handle.rb#28
|
615
|
+
def index; end
|
616
|
+
|
617
|
+
# source://puma//lib/puma/cluster/worker_handle.rb#86
|
618
|
+
def kill; end
|
619
|
+
|
620
|
+
# Returns the value of attribute last_checkin.
|
621
|
+
#
|
622
|
+
# source://puma//lib/puma/cluster/worker_handle.rb#28
|
623
|
+
def last_checkin; end
|
624
|
+
|
625
|
+
# Returns the value of attribute last_status.
|
626
|
+
#
|
627
|
+
# source://puma//lib/puma/cluster/worker_handle.rb#28
|
628
|
+
def last_status; end
|
629
|
+
|
630
|
+
# Returns the value of attribute phase.
|
631
|
+
#
|
632
|
+
# source://puma//lib/puma/cluster/worker_handle.rb#28
|
633
|
+
def phase; end
|
634
|
+
|
635
|
+
# @version 5.0.0
|
636
|
+
#
|
637
|
+
# source://puma//lib/puma/cluster/worker_handle.rb#31
|
638
|
+
def phase=(_arg0); end
|
639
|
+
|
640
|
+
# Returns the value of attribute pid.
|
641
|
+
#
|
642
|
+
# source://puma//lib/puma/cluster/worker_handle.rb#28
|
643
|
+
def pid; end
|
644
|
+
|
645
|
+
# @version 5.0.0
|
646
|
+
#
|
647
|
+
# source://puma//lib/puma/cluster/worker_handle.rb#31
|
648
|
+
def pid=(_arg0); end
|
649
|
+
|
650
|
+
# source://puma//lib/puma/cluster/worker_handle.rb#54
|
651
|
+
def ping!(status); end
|
652
|
+
|
653
|
+
# @see Puma::Cluster#check_workers
|
654
|
+
# @version 5.0.0
|
655
|
+
#
|
656
|
+
# source://puma//lib/puma/cluster/worker_handle.rb#65
|
657
|
+
def ping_timeout; end
|
658
|
+
|
659
|
+
# Returns the value of attribute signal.
|
660
|
+
#
|
661
|
+
# source://puma//lib/puma/cluster/worker_handle.rb#28
|
662
|
+
def signal; end
|
663
|
+
|
664
|
+
# Returns the value of attribute started_at.
|
665
|
+
#
|
666
|
+
# source://puma//lib/puma/cluster/worker_handle.rb#28
|
667
|
+
def started_at; end
|
668
|
+
|
669
|
+
# source://puma//lib/puma/cluster/worker_handle.rb#73
|
670
|
+
def term; end
|
671
|
+
|
672
|
+
# source://puma//lib/puma/cluster/worker_handle.rb#46
|
673
|
+
def term!; end
|
674
|
+
|
675
|
+
# @return [Boolean]
|
676
|
+
#
|
677
|
+
# source://puma//lib/puma/cluster/worker_handle.rb#50
|
678
|
+
def term?; end
|
679
|
+
|
680
|
+
# source://puma//lib/puma/cluster/worker_handle.rb#37
|
681
|
+
def uptime; end
|
682
|
+
end
|
683
|
+
|
684
|
+
# The main configuration class of Puma.
|
685
|
+
#
|
686
|
+
# It can be initialized with a set of "user" options and "default" options.
|
687
|
+
# Defaults will be merged with `Configuration.puma_default_options`.
|
688
|
+
#
|
689
|
+
# This class works together with 2 main other classes the `UserFileDefaultOptions`
|
690
|
+
# which stores configuration options in order so the precedence is that user
|
691
|
+
# set configuration wins over "file" based configuration wins over "default"
|
692
|
+
# configuration. These configurations are set via the `DSL` class. This
|
693
|
+
# class powers the Puma config file syntax and does double duty as a configuration
|
694
|
+
# DSL used by the `Puma::CLI` and Puma rack handler.
|
695
|
+
#
|
696
|
+
# It also handles loading plugins.
|
697
|
+
#
|
698
|
+
# [Note:]
|
699
|
+
# `:port` and `:host` are not valid keys. By the time they make it to the
|
700
|
+
# configuration options they are expected to be incorporated into a `:binds` key.
|
701
|
+
# Under the hood the DSL maps `port` and `host` calls to `:binds`
|
702
|
+
#
|
703
|
+
# config = Configuration.new({}) do |user_config, file_config, default_config|
|
704
|
+
# user_config.port 3003
|
705
|
+
# end
|
706
|
+
# config.load
|
707
|
+
# puts config.options[:port]
|
708
|
+
# # => 3003
|
709
|
+
#
|
710
|
+
# It is expected that `load` is called on the configuration instance after setting
|
711
|
+
# config. This method expands any values in `config_file` and puts them into the
|
712
|
+
# correct configuration option hash.
|
713
|
+
#
|
714
|
+
# Once all configuration is complete it is expected that `clamp` will be called
|
715
|
+
# on the instance. This will expand any procs stored under "default" values. This
|
716
|
+
# is done because an environment variable may have been modified while loading
|
717
|
+
# configuration files.
|
718
|
+
class Puma::Configuration
|
719
|
+
# @return [Configuration] a new instance of Configuration
|
720
|
+
#
|
721
|
+
# source://puma//lib/puma/configuration.rb#172
|
722
|
+
def initialize(user_options = T.unsafe(nil), default_options = T.unsafe(nil), &block); end
|
723
|
+
|
724
|
+
# Load the specified rackup file, pull options from
|
725
|
+
# the rackup file, and set @app.
|
726
|
+
#
|
727
|
+
# source://puma//lib/puma/configuration.rb#285
|
728
|
+
def app; end
|
729
|
+
|
730
|
+
# Indicate if there is a properly configured app
|
731
|
+
#
|
732
|
+
# @return [Boolean]
|
733
|
+
#
|
734
|
+
# source://puma//lib/puma/configuration.rb#274
|
735
|
+
def app_configured?; end
|
736
|
+
|
737
|
+
# Call once all configuration (included from rackup files)
|
738
|
+
# is loaded to flesh out any defaults
|
739
|
+
#
|
740
|
+
# source://puma//lib/puma/configuration.rb#255
|
741
|
+
def clamp; end
|
742
|
+
|
743
|
+
# source://puma//lib/puma/configuration.rb#240
|
744
|
+
def config_files; end
|
745
|
+
|
746
|
+
# source://puma//lib/puma/configuration.rb#192
|
747
|
+
def configure; end
|
748
|
+
|
749
|
+
# Return which environment we're running in
|
750
|
+
#
|
751
|
+
# source://puma//lib/puma/configuration.rb#298
|
752
|
+
def environment; end
|
753
|
+
|
754
|
+
# source://puma//lib/puma/configuration.rb#325
|
755
|
+
def final_options; end
|
756
|
+
|
757
|
+
# source://puma//lib/puma/configuration.rb#206
|
758
|
+
def flatten; end
|
759
|
+
|
760
|
+
# source://puma//lib/puma/configuration.rb#210
|
761
|
+
def flatten!; end
|
762
|
+
|
763
|
+
# source://puma//lib/puma/configuration.rb#234
|
764
|
+
def load; end
|
765
|
+
|
766
|
+
# source://puma//lib/puma/configuration.rb#302
|
767
|
+
def load_plugin(name); end
|
768
|
+
|
769
|
+
# Returns the value of attribute options.
|
770
|
+
#
|
771
|
+
# source://puma//lib/puma/configuration.rb#190
|
772
|
+
def options; end
|
773
|
+
|
774
|
+
# Returns the value of attribute plugins.
|
775
|
+
#
|
776
|
+
# source://puma//lib/puma/configuration.rb#190
|
777
|
+
def plugins; end
|
778
|
+
|
779
|
+
# source://puma//lib/puma/configuration.rb#215
|
780
|
+
def puma_default_options; end
|
781
|
+
|
782
|
+
# source://puma//lib/puma/configuration.rb#221
|
783
|
+
def puma_options_from_env; end
|
784
|
+
|
785
|
+
# source://puma//lib/puma/configuration.rb#278
|
786
|
+
def rackup; end
|
787
|
+
|
788
|
+
# @param key [:Symbol] hook to run
|
789
|
+
# @param arg [Launcher, Int] `:on_restart` passes Launcher
|
790
|
+
#
|
791
|
+
# source://puma//lib/puma/configuration.rb#309
|
792
|
+
def run_hooks(key, arg, log_writer, hook_data = T.unsafe(nil)); end
|
793
|
+
|
794
|
+
private
|
795
|
+
|
796
|
+
# source://puma//lib/puma/configuration.rb#200
|
797
|
+
def initialize_copy(other); end
|
798
|
+
|
799
|
+
# source://puma//lib/puma/configuration.rb#361
|
800
|
+
def load_rackup; end
|
801
|
+
|
802
|
+
# Load and use the normal Rack builder if we can, otherwise
|
803
|
+
# fallback to our minimal version.
|
804
|
+
#
|
805
|
+
# source://puma//lib/puma/configuration.rb#340
|
806
|
+
def rack_builder; end
|
807
|
+
|
808
|
+
class << self
|
809
|
+
# source://puma//lib/puma/configuration.rb#379
|
810
|
+
def random_token; end
|
811
|
+
|
812
|
+
# source://puma//lib/puma/configuration.rb#329
|
813
|
+
def temp_path; end
|
814
|
+
end
|
815
|
+
end
|
816
|
+
|
817
|
+
# Injects the Configuration object into the env
|
818
|
+
class Puma::Configuration::ConfigMiddleware
|
819
|
+
# @return [ConfigMiddleware] a new instance of ConfigMiddleware
|
820
|
+
#
|
821
|
+
# source://puma//lib/puma/configuration.rb#261
|
822
|
+
def initialize(config, app); end
|
823
|
+
|
824
|
+
# source://puma//lib/puma/configuration.rb#266
|
825
|
+
def call(env); end
|
826
|
+
end
|
827
|
+
|
828
|
+
# source://puma//lib/puma/configuration.rb#129
|
829
|
+
Puma::Configuration::DEFAULTS = T.let(T.unsafe(nil), Hash)
|
830
|
+
|
831
|
+
class Puma::ConnectionError < ::RuntimeError; end
|
832
|
+
|
833
|
+
# Frequently used constants when constructing requests or responses. Many times
|
834
|
+
# the constant just refers to a string with the same contents. Using these constants
|
835
|
+
# gave about a 3% to 10% performance improvement over using the strings directly.
|
836
|
+
#
|
837
|
+
# The constants are frozen because Hash#[]= when called with a String key dups
|
838
|
+
# the String UNLESS the String is frozen. This saves us therefore 2 object
|
839
|
+
# allocations when creating the env hash later.
|
840
|
+
#
|
841
|
+
# While Puma does try to emulate the CGI/1.2 protocol, it does not use the REMOTE_IDENT,
|
842
|
+
# REMOTE_USER, or REMOTE_HOST parameters since those are either a security problem or
|
843
|
+
# too taxing on performance.
|
844
|
+
module Puma::Const; end
|
845
|
+
|
846
|
+
# Banned keys of response header
|
847
|
+
#
|
848
|
+
# source://puma//lib/puma/const.rb#244
|
849
|
+
Puma::Const::BANNED_HEADER_KEY = T.let(T.unsafe(nil), Regexp)
|
850
|
+
|
851
|
+
# source://puma//lib/puma/const.rb#183
|
852
|
+
Puma::Const::CGI_VER = T.let(T.unsafe(nil), String)
|
853
|
+
|
854
|
+
# source://puma//lib/puma/const.rb#224
|
855
|
+
Puma::Const::CHUNKED = T.let(T.unsafe(nil), String)
|
856
|
+
|
857
|
+
# The basic max request size we'll try to read.
|
858
|
+
#
|
859
|
+
# source://puma//lib/puma/const.rb#140
|
860
|
+
Puma::Const::CHUNK_SIZE = T.let(T.unsafe(nil), Integer)
|
861
|
+
|
862
|
+
# source://puma//lib/puma/const.rb#210
|
863
|
+
Puma::Const::CLOSE = T.let(T.unsafe(nil), String)
|
864
|
+
|
865
|
+
# source://puma//lib/puma/const.rb#222
|
866
|
+
Puma::Const::CLOSE_CHUNKED = T.let(T.unsafe(nil), String)
|
867
|
+
|
868
|
+
# source://puma//lib/puma/const.rb#104
|
869
|
+
Puma::Const::CODE_NAME = T.let(T.unsafe(nil), String)
|
870
|
+
|
871
|
+
# source://puma//lib/puma/const.rb#226
|
872
|
+
Puma::Const::COLON = T.let(T.unsafe(nil), String)
|
873
|
+
|
874
|
+
# source://puma//lib/puma/const.rb#218
|
875
|
+
Puma::Const::CONNECTION_CLOSE = T.let(T.unsafe(nil), String)
|
876
|
+
|
877
|
+
# source://puma//lib/puma/const.rb#219
|
878
|
+
Puma::Const::CONNECTION_KEEP_ALIVE = T.let(T.unsafe(nil), String)
|
879
|
+
|
880
|
+
# source://puma//lib/puma/const.rb#118
|
881
|
+
Puma::Const::CONTENT_LENGTH = T.let(T.unsafe(nil), String)
|
882
|
+
|
883
|
+
# source://puma//lib/puma/const.rb#213
|
884
|
+
Puma::Const::CONTENT_LENGTH2 = T.let(T.unsafe(nil), String)
|
885
|
+
|
886
|
+
# source://puma//lib/puma/const.rb#214
|
887
|
+
Puma::Const::CONTENT_LENGTH_S = T.let(T.unsafe(nil), String)
|
888
|
+
|
889
|
+
# source://puma//lib/puma/const.rb#204
|
890
|
+
Puma::Const::CONTINUE = T.let(T.unsafe(nil), String)
|
891
|
+
|
892
|
+
# source://puma//lib/puma/const.rb#154
|
893
|
+
Puma::Const::DELETE = T.let(T.unsafe(nil), String)
|
894
|
+
|
895
|
+
# Illegal character in the key or value of response header
|
896
|
+
#
|
897
|
+
# source://puma//lib/puma/const.rb#237
|
898
|
+
Puma::Const::DQUOTE = T.let(T.unsafe(nil), String)
|
899
|
+
|
900
|
+
# source://puma//lib/puma/const.rb#234
|
901
|
+
Puma::Const::EARLY_HINTS = T.let(T.unsafe(nil), String)
|
902
|
+
|
903
|
+
# source://puma//lib/puma/const.rb#124
|
904
|
+
Puma::Const::ERROR_RESPONSE = T.let(T.unsafe(nil), Hash)
|
905
|
+
|
906
|
+
# source://puma//lib/puma/const.rb#108
|
907
|
+
Puma::Const::FAST_TRACK_KA_TIMEOUT = T.let(T.unsafe(nil), Float)
|
908
|
+
|
909
|
+
# source://puma//lib/puma/const.rb#182
|
910
|
+
Puma::Const::GATEWAY_INTERFACE = T.let(T.unsafe(nil), String)
|
911
|
+
|
912
|
+
# source://puma//lib/puma/const.rb#151
|
913
|
+
Puma::Const::GET = T.let(T.unsafe(nil), String)
|
914
|
+
|
915
|
+
# source://puma//lib/puma/const.rb#186
|
916
|
+
Puma::Const::HALT_COMMAND = T.let(T.unsafe(nil), String)
|
917
|
+
|
918
|
+
# source://puma//lib/puma/const.rb#150
|
919
|
+
Puma::Const::HEAD = T.let(T.unsafe(nil), String)
|
920
|
+
|
921
|
+
# source://puma//lib/puma/const.rb#231
|
922
|
+
Puma::Const::HIJACK = T.let(T.unsafe(nil), String)
|
923
|
+
|
924
|
+
# source://puma//lib/puma/const.rb#232
|
925
|
+
Puma::Const::HIJACK_IO = T.let(T.unsafe(nil), String)
|
926
|
+
|
927
|
+
# source://puma//lib/puma/const.rb#230
|
928
|
+
Puma::Const::HIJACK_P = T.let(T.unsafe(nil), String)
|
929
|
+
|
930
|
+
# source://puma//lib/puma/const.rb#196
|
931
|
+
Puma::Const::HTTP = T.let(T.unsafe(nil), String)
|
932
|
+
|
933
|
+
# source://puma//lib/puma/const.rb#197
|
934
|
+
Puma::Const::HTTPS = T.let(T.unsafe(nil), String)
|
935
|
+
|
936
|
+
# source://puma//lib/puma/const.rb#199
|
937
|
+
Puma::Const::HTTPS_KEY = T.let(T.unsafe(nil), String)
|
938
|
+
|
939
|
+
# source://puma//lib/puma/const.rb#208
|
940
|
+
Puma::Const::HTTP_10_200 = T.let(T.unsafe(nil), String)
|
941
|
+
|
942
|
+
# source://puma//lib/puma/const.rb#179
|
943
|
+
Puma::Const::HTTP_11 = T.let(T.unsafe(nil), String)
|
944
|
+
|
945
|
+
# source://puma//lib/puma/const.rb#206
|
946
|
+
Puma::Const::HTTP_11_100 = T.let(T.unsafe(nil), String)
|
947
|
+
|
948
|
+
# source://puma//lib/puma/const.rb#207
|
949
|
+
Puma::Const::HTTP_11_200 = T.let(T.unsafe(nil), String)
|
950
|
+
|
951
|
+
# source://puma//lib/puma/const.rb#202
|
952
|
+
Puma::Const::HTTP_CONNECTION = T.let(T.unsafe(nil), String)
|
953
|
+
|
954
|
+
# source://puma//lib/puma/const.rb#203
|
955
|
+
Puma::Const::HTTP_EXPECT = T.let(T.unsafe(nil), String)
|
956
|
+
|
957
|
+
# source://puma//lib/puma/const.rb#238
|
958
|
+
Puma::Const::HTTP_HEADER_DELIMITER = T.let(T.unsafe(nil), String)
|
959
|
+
|
960
|
+
# source://puma//lib/puma/const.rb#169
|
961
|
+
Puma::Const::HTTP_HOST = T.let(T.unsafe(nil), String)
|
962
|
+
|
963
|
+
# source://puma//lib/puma/const.rb#201
|
964
|
+
Puma::Const::HTTP_VERSION = T.let(T.unsafe(nil), String)
|
965
|
+
|
966
|
+
# source://puma//lib/puma/const.rb#162
|
967
|
+
Puma::Const::HTTP_X_FORWARDED_FOR = T.let(T.unsafe(nil), String)
|
968
|
+
|
969
|
+
# source://puma//lib/puma/const.rb#165
|
970
|
+
Puma::Const::HTTP_X_FORWARDED_PROTO = T.let(T.unsafe(nil), String)
|
971
|
+
|
972
|
+
# source://puma//lib/puma/const.rb#164
|
973
|
+
Puma::Const::HTTP_X_FORWARDED_SCHEME = T.let(T.unsafe(nil), String)
|
974
|
+
|
975
|
+
# source://puma//lib/puma/const.rb#163
|
976
|
+
Puma::Const::HTTP_X_FORWARDED_SSL = T.let(T.unsafe(nil), String)
|
977
|
+
|
978
|
+
# source://puma//lib/puma/const.rb#239
|
979
|
+
Puma::Const::ILLEGAL_HEADER_KEY_REGEX = T.let(T.unsafe(nil), Regexp)
|
980
|
+
|
981
|
+
# header values can contain HTAB?
|
982
|
+
#
|
983
|
+
# source://puma//lib/puma/const.rb#241
|
984
|
+
Puma::Const::ILLEGAL_HEADER_VALUE_REGEX = T.let(T.unsafe(nil), Regexp)
|
985
|
+
|
986
|
+
# source://puma//lib/puma/const.rb#211
|
987
|
+
Puma::Const::KEEP_ALIVE = T.let(T.unsafe(nil), String)
|
988
|
+
|
989
|
+
# ETag is based on the apache standard of hex mtime-size-inode (inode is 0 on win32)
|
990
|
+
#
|
991
|
+
# source://puma//lib/puma/const.rb#160
|
992
|
+
Puma::Const::LINE_END = T.let(T.unsafe(nil), String)
|
993
|
+
|
994
|
+
# source://puma//lib/puma/const.rb#172
|
995
|
+
Puma::Const::LOCALHOST = T.let(T.unsafe(nil), String)
|
996
|
+
|
997
|
+
# source://puma//lib/puma/const.rb#173
|
998
|
+
Puma::Const::LOCALHOST_IPV4 = T.let(T.unsafe(nil), String)
|
999
|
+
|
1000
|
+
# source://puma//lib/puma/const.rb#174
|
1001
|
+
Puma::Const::LOCALHOST_IPV6 = T.let(T.unsafe(nil), String)
|
1002
|
+
|
1003
|
+
# Maximum request body size before it is moved out of memory and into a tempfile for reading.
|
1004
|
+
#
|
1005
|
+
# source://puma//lib/puma/const.rb#147
|
1006
|
+
Puma::Const::MAX_BODY = T.let(T.unsafe(nil), Integer)
|
1007
|
+
|
1008
|
+
# This is the maximum header that is allowed before a client is booted. The parser detects
|
1009
|
+
# this, but we'd also like to do this as well.
|
1010
|
+
#
|
1011
|
+
# source://puma//lib/puma/const.rb#144
|
1012
|
+
Puma::Const::MAX_HEADER = T.let(T.unsafe(nil), Integer)
|
1013
|
+
|
1014
|
+
# source://puma//lib/puma/const.rb#228
|
1015
|
+
Puma::Const::NEWLINE = T.let(T.unsafe(nil), String)
|
1016
|
+
|
1017
|
+
# source://puma//lib/puma/const.rb#155
|
1018
|
+
Puma::Const::OPTIONS = T.let(T.unsafe(nil), String)
|
1019
|
+
|
1020
|
+
# source://puma//lib/puma/const.rb#157
|
1021
|
+
Puma::Const::PATCH = T.let(T.unsafe(nil), String)
|
1022
|
+
|
1023
|
+
# source://puma//lib/puma/const.rb#120
|
1024
|
+
Puma::Const::PATH_INFO = T.let(T.unsafe(nil), String)
|
1025
|
+
|
1026
|
+
# source://puma//lib/puma/const.rb#171
|
1027
|
+
Puma::Const::PORT_443 = T.let(T.unsafe(nil), String)
|
1028
|
+
|
1029
|
+
# source://puma//lib/puma/const.rb#170
|
1030
|
+
Puma::Const::PORT_80 = T.let(T.unsafe(nil), String)
|
1031
|
+
|
1032
|
+
# source://puma//lib/puma/const.rb#152
|
1033
|
+
Puma::Const::POST = T.let(T.unsafe(nil), String)
|
1034
|
+
|
1035
|
+
# source://puma//lib/puma/const.rb#246
|
1036
|
+
Puma::Const::PROXY_PROTOCOL_V1_REGEX = T.let(T.unsafe(nil), Regexp)
|
1037
|
+
|
1038
|
+
# source://puma//lib/puma/const.rb#193
|
1039
|
+
Puma::Const::PUMA_CONFIG = T.let(T.unsafe(nil), String)
|
1040
|
+
|
1041
|
+
# source://puma//lib/puma/const.rb#194
|
1042
|
+
Puma::Const::PUMA_PEERCERT = T.let(T.unsafe(nil), String)
|
1043
|
+
|
1044
|
+
# source://puma//lib/puma/const.rb#106
|
1045
|
+
Puma::Const::PUMA_SERVER_STRING = T.let(T.unsafe(nil), String)
|
1046
|
+
|
1047
|
+
# source://puma//lib/puma/const.rb#192
|
1048
|
+
Puma::Const::PUMA_SOCKET = T.let(T.unsafe(nil), String)
|
1049
|
+
|
1050
|
+
# source://puma//lib/puma/const.rb#122
|
1051
|
+
Puma::Const::PUMA_TMP_BASE = T.let(T.unsafe(nil), String)
|
1052
|
+
|
1053
|
+
# source://puma//lib/puma/const.rb#103
|
1054
|
+
Puma::Const::PUMA_VERSION = T.let(T.unsafe(nil), String)
|
1055
|
+
|
1056
|
+
# source://puma//lib/puma/const.rb#153
|
1057
|
+
Puma::Const::PUT = T.let(T.unsafe(nil), String)
|
1058
|
+
|
1059
|
+
# source://puma//lib/puma/const.rb#117
|
1060
|
+
Puma::Const::QUERY_STRING = T.let(T.unsafe(nil), String)
|
1061
|
+
|
1062
|
+
# source://puma//lib/puma/const.rb#191
|
1063
|
+
Puma::Const::RACK_AFTER_REPLY = T.let(T.unsafe(nil), String)
|
1064
|
+
|
1065
|
+
# source://puma//lib/puma/const.rb#189
|
1066
|
+
Puma::Const::RACK_INPUT = T.let(T.unsafe(nil), String)
|
1067
|
+
|
1068
|
+
# source://puma//lib/puma/const.rb#190
|
1069
|
+
Puma::Const::RACK_URL_SCHEME = T.let(T.unsafe(nil), String)
|
1070
|
+
|
1071
|
+
# source://puma//lib/puma/const.rb#161
|
1072
|
+
Puma::Const::REMOTE_ADDR = T.let(T.unsafe(nil), String)
|
1073
|
+
|
1074
|
+
# source://puma//lib/puma/const.rb#149
|
1075
|
+
Puma::Const::REQUEST_METHOD = T.let(T.unsafe(nil), String)
|
1076
|
+
|
1077
|
+
# source://puma//lib/puma/const.rb#116
|
1078
|
+
Puma::Const::REQUEST_PATH = T.let(T.unsafe(nil), String)
|
1079
|
+
|
1080
|
+
# The original URI requested by the client.
|
1081
|
+
#
|
1082
|
+
# source://puma//lib/puma/const.rb#115
|
1083
|
+
Puma::Const::REQUEST_URI = T.let(T.unsafe(nil), String)
|
1084
|
+
|
1085
|
+
# source://puma//lib/puma/const.rb#187
|
1086
|
+
Puma::Const::RESTART_COMMAND = T.let(T.unsafe(nil), String)
|
1087
|
+
|
1088
|
+
# source://puma//lib/puma/const.rb#167
|
1089
|
+
Puma::Const::SERVER_NAME = T.let(T.unsafe(nil), String)
|
1090
|
+
|
1091
|
+
# source://puma//lib/puma/const.rb#168
|
1092
|
+
Puma::Const::SERVER_PORT = T.let(T.unsafe(nil), String)
|
1093
|
+
|
1094
|
+
# source://puma//lib/puma/const.rb#178
|
1095
|
+
Puma::Const::SERVER_PROTOCOL = T.let(T.unsafe(nil), String)
|
1096
|
+
|
1097
|
+
# source://puma//lib/puma/const.rb#181
|
1098
|
+
Puma::Const::SERVER_SOFTWARE = T.let(T.unsafe(nil), String)
|
1099
|
+
|
1100
|
+
# source://puma//lib/puma/const.rb#185
|
1101
|
+
Puma::Const::STOP_COMMAND = T.let(T.unsafe(nil), String)
|
1102
|
+
|
1103
|
+
# source://puma//lib/puma/const.rb#158
|
1104
|
+
Puma::Const::SUPPORTED_HTTP_METHODS = T.let(T.unsafe(nil), Array)
|
1105
|
+
|
1106
|
+
# source://puma//lib/puma/const.rb#156
|
1107
|
+
Puma::Const::TRACE = T.let(T.unsafe(nil), String)
|
1108
|
+
|
1109
|
+
# source://puma//lib/puma/const.rb#215
|
1110
|
+
Puma::Const::TRANSFER_ENCODING = T.let(T.unsafe(nil), String)
|
1111
|
+
|
1112
|
+
# source://puma//lib/puma/const.rb#216
|
1113
|
+
Puma::Const::TRANSFER_ENCODING2 = T.let(T.unsafe(nil), String)
|
1114
|
+
|
1115
|
+
# source://puma//lib/puma/const.rb#221
|
1116
|
+
Puma::Const::TRANSFER_ENCODING_CHUNKED = T.let(T.unsafe(nil), String)
|
1117
|
+
|
1118
|
+
# source://puma//lib/puma/const.rb#175
|
1119
|
+
Puma::Const::UNSPECIFIED_IPV4 = T.let(T.unsafe(nil), String)
|
1120
|
+
|
1121
|
+
# source://puma//lib/puma/const.rb#176
|
1122
|
+
Puma::Const::UNSPECIFIED_IPV6 = T.let(T.unsafe(nil), String)
|
1123
|
+
|
1124
|
+
# source://puma//lib/puma/const.rb#103
|
1125
|
+
Puma::Const::VERSION = T.let(T.unsafe(nil), String)
|
1126
|
+
|
1127
|
+
# How long to wait when getting some write blocking on the socket when
|
1128
|
+
# sending data back
|
1129
|
+
#
|
1130
|
+
# source://puma//lib/puma/const.rb#112
|
1131
|
+
Puma::Const::WRITE_TIMEOUT = T.let(T.unsafe(nil), Integer)
|
1132
|
+
|
1133
|
+
# The methods that are available for use inside the configuration file.
|
1134
|
+
# These same methods are used in Puma cli and the rack handler
|
1135
|
+
# internally.
|
1136
|
+
#
|
1137
|
+
# Used manually (via CLI class):
|
1138
|
+
#
|
1139
|
+
# config = Configuration.new({}) do |user_config|
|
1140
|
+
# user_config.port 3001
|
1141
|
+
# end
|
1142
|
+
# config.load
|
1143
|
+
#
|
1144
|
+
# puts config.options[:binds] # => "tcp://127.0.0.1:3001"
|
1145
|
+
#
|
1146
|
+
# Used to load file:
|
1147
|
+
#
|
1148
|
+
# $ cat puma_config.rb
|
1149
|
+
# port 3002
|
1150
|
+
#
|
1151
|
+
# Resulting configuration:
|
1152
|
+
#
|
1153
|
+
# config = Configuration.new(config_file: "puma_config.rb")
|
1154
|
+
# config.load
|
1155
|
+
#
|
1156
|
+
# puts config.options[:binds] # => "tcp://127.0.0.1:3002"
|
1157
|
+
#
|
1158
|
+
# You can also find many examples being used by the test suite in
|
1159
|
+
# +test/config+.
|
1160
|
+
#
|
1161
|
+
# Puma v6 adds the option to specify a key name (String or Symbol) to the
|
1162
|
+
# hooks that run inside the forked workers. All the hooks run inside the
|
1163
|
+
# {Puma::Cluster::Worker#run} method.
|
1164
|
+
#
|
1165
|
+
# Previously, the worker index and the LogWriter instance were passed to the
|
1166
|
+
# hook blocks/procs. If a key name is specified, a hash is passed as the last
|
1167
|
+
# parameter. This allows storage of data, typically objects that are created
|
1168
|
+
# before the worker that need to be passed to the hook when the worker is shutdown.
|
1169
|
+
#
|
1170
|
+
# The following hooks have been updated:
|
1171
|
+
#
|
1172
|
+
# | DSL Method | Options Key | Fork Block Location |
|
1173
|
+
# | on_worker_boot | :before_worker_boot | inside, before |
|
1174
|
+
# | on_worker_shutdown | :before_worker_shutdown | inside, after |
|
1175
|
+
# | on_refork | :before_refork | inside |
|
1176
|
+
class Puma::DSL
|
1177
|
+
# @return [DSL] a new instance of DSL
|
1178
|
+
#
|
1179
|
+
# source://puma//lib/puma/dsl.rb#121
|
1180
|
+
def initialize(options, config); end
|
1181
|
+
|
1182
|
+
# source://puma//lib/puma/dsl.rb#128
|
1183
|
+
def _load_from(path); end
|
1184
|
+
|
1185
|
+
# source://puma//lib/puma/dsl.rb#137
|
1186
|
+
def _offer_plugins; end
|
1187
|
+
|
1188
|
+
# Start the Puma control rack application on +url+. This application can
|
1189
|
+
# be communicated with to control the main server. Additionally, you can
|
1190
|
+
# provide an authentication token, so all requests to the control server
|
1191
|
+
# will need to include that token as a query parameter. This allows for
|
1192
|
+
# simple authentication.
|
1193
|
+
#
|
1194
|
+
# Check out {Puma::App::Status} to see what the app has available.
|
1195
|
+
#
|
1196
|
+
# @example
|
1197
|
+
# activate_control_app 'unix:///var/run/pumactl.sock'
|
1198
|
+
# @example
|
1199
|
+
# activate_control_app 'unix:///var/run/pumactl.sock', { auth_token: '12345' }
|
1200
|
+
# @example
|
1201
|
+
# activate_control_app 'unix:///var/run/pumactl.sock', { no_token: true }
|
1202
|
+
#
|
1203
|
+
# source://puma//lib/puma/dsl.rb#211
|
1204
|
+
def activate_control_app(url = T.unsafe(nil), opts = T.unsafe(nil)); end
|
1205
|
+
|
1206
|
+
# Code to run in the master after a worker has been started. The worker's
|
1207
|
+
# index is passed as an argument.
|
1208
|
+
#
|
1209
|
+
# This is called everytime a worker is to be started.
|
1210
|
+
#
|
1211
|
+
# @example
|
1212
|
+
# after_worker_fork do
|
1213
|
+
# puts 'After worker fork...'
|
1214
|
+
# end
|
1215
|
+
# @note Cluster mode only.
|
1216
|
+
#
|
1217
|
+
# source://puma//lib/puma/dsl.rb#657
|
1218
|
+
def after_worker_boot(&block); end
|
1219
|
+
|
1220
|
+
# Code to run in the master after a worker has been started. The worker's
|
1221
|
+
# index is passed as an argument.
|
1222
|
+
#
|
1223
|
+
# This is called everytime a worker is to be started.
|
1224
|
+
#
|
1225
|
+
# @example
|
1226
|
+
# after_worker_fork do
|
1227
|
+
# puts 'After worker fork...'
|
1228
|
+
# end
|
1229
|
+
# @note Cluster mode only.
|
1230
|
+
#
|
1231
|
+
# source://puma//lib/puma/dsl.rb#657
|
1232
|
+
def after_worker_fork(&block); end
|
1233
|
+
|
1234
|
+
# Use an object or block as the rack application. This allows the
|
1235
|
+
# configuration file to be the application itself.
|
1236
|
+
#
|
1237
|
+
# @example
|
1238
|
+
# app do |env|
|
1239
|
+
# body = 'Hello, World!'
|
1240
|
+
#
|
1241
|
+
# [
|
1242
|
+
# 200,
|
1243
|
+
# {
|
1244
|
+
# 'Content-Type' => 'text/plain',
|
1245
|
+
# 'Content-Length' => body.length.to_s
|
1246
|
+
# },
|
1247
|
+
# [body]
|
1248
|
+
# ]
|
1249
|
+
# end
|
1250
|
+
# @see Puma::Configuration#app
|
1251
|
+
#
|
1252
|
+
# source://puma//lib/puma/dsl.rb#189
|
1253
|
+
def app(obj = T.unsafe(nil), &block); end
|
1254
|
+
|
1255
|
+
# Code to run immediately before master process
|
1256
|
+
# forks workers (once on boot). These hooks can block if necessary
|
1257
|
+
# to wait for background operations unknown to Puma to finish before
|
1258
|
+
# the process terminates.
|
1259
|
+
# This can be used to close any connections to remote servers (database,
|
1260
|
+
# Redis, ...) that were opened when preloading the code.
|
1261
|
+
#
|
1262
|
+
# This can be called multiple times to add several hooks.
|
1263
|
+
#
|
1264
|
+
# @example
|
1265
|
+
# before_fork do
|
1266
|
+
# puts "Starting workers..."
|
1267
|
+
# end
|
1268
|
+
# @note Cluster mode only.
|
1269
|
+
#
|
1270
|
+
# source://puma//lib/puma/dsl.rb#598
|
1271
|
+
def before_fork(&block); end
|
1272
|
+
|
1273
|
+
# Bind the server to +url+. "tcp://", "unix://" and "ssl://" are the only
|
1274
|
+
# accepted protocols. Multiple urls can be bound to, calling +bind+ does
|
1275
|
+
# not overwrite previous bindings.
|
1276
|
+
#
|
1277
|
+
# The default is "tcp://0.0.0.0:9292".
|
1278
|
+
#
|
1279
|
+
# You can use query parameters within the url to specify options:
|
1280
|
+
#
|
1281
|
+
# * Set the socket backlog depth with +backlog+, default is 1024.
|
1282
|
+
# * Set up an SSL certificate with +key+ & +cert+.
|
1283
|
+
# * Set whether to optimize for low latency instead of throughput with
|
1284
|
+
# +low_latency+, default is to not optimize for low latency. This is done
|
1285
|
+
# via +Socket::TCP_NODELAY+.
|
1286
|
+
# * Set socket permissions with +umask+.
|
1287
|
+
#
|
1288
|
+
# @example Backlog depth
|
1289
|
+
# bind 'unix:///var/run/puma.sock?backlog=512'
|
1290
|
+
# @example SSL cert
|
1291
|
+
# bind 'ssl://127.0.0.1:9292?key=key.key&cert=cert.pem'
|
1292
|
+
# @example Disable optimization for low latency
|
1293
|
+
# bind 'tcp://0.0.0.0:9292?low_latency=false'
|
1294
|
+
# @example Socket permissions
|
1295
|
+
# bind 'unix:///var/run/puma.sock?umask=0111'
|
1296
|
+
# @see Puma::Runner#load_and_bind
|
1297
|
+
# @see Puma::Cluster#run
|
1298
|
+
#
|
1299
|
+
# source://puma//lib/puma/dsl.rb#269
|
1300
|
+
def bind(url); end
|
1301
|
+
|
1302
|
+
# Bind to (systemd) activated sockets, regardless of configured binds.
|
1303
|
+
#
|
1304
|
+
# Systemd can present sockets as file descriptors that are already opened.
|
1305
|
+
# By default Puma will use these but only if it was explicitly told to bind
|
1306
|
+
# to the socket. If not, it will close the activated sockets. This means
|
1307
|
+
# all configuration is duplicated.
|
1308
|
+
#
|
1309
|
+
# Binds can contain additional configuration, but only SSL config is really
|
1310
|
+
# relevant since the unix and TCP socket options are ignored.
|
1311
|
+
#
|
1312
|
+
# This means there is a lot of duplicated configuration for no additional
|
1313
|
+
# value in most setups. This method tells the launcher to bind to all
|
1314
|
+
# activated sockets, regardless of existing bind.
|
1315
|
+
#
|
1316
|
+
# To clear configured binds, the value only can be passed. This will clear
|
1317
|
+
# out any binds that may have been configured.
|
1318
|
+
#
|
1319
|
+
# @example Use any systemd activated sockets as well as configured binds
|
1320
|
+
# bind_to_activated_sockets
|
1321
|
+
# @example Only bind to systemd activated sockets, ignoring other binds
|
1322
|
+
# bind_to_activated_sockets 'only'
|
1323
|
+
#
|
1324
|
+
# source://puma//lib/puma/dsl.rb#300
|
1325
|
+
def bind_to_activated_sockets(bind = T.unsafe(nil)); end
|
1326
|
+
|
1327
|
+
# Work around leaky apps that leave garbage in Thread locals
|
1328
|
+
# across requests.
|
1329
|
+
#
|
1330
|
+
# source://puma//lib/puma/dsl.rb#327
|
1331
|
+
def clean_thread_locals(which = T.unsafe(nil)); end
|
1332
|
+
|
1333
|
+
# source://puma//lib/puma/dsl.rb#274
|
1334
|
+
def clear_binds!; end
|
1335
|
+
|
1336
|
+
# Show debugging info
|
1337
|
+
#
|
1338
|
+
# source://puma//lib/puma/dsl.rb#420
|
1339
|
+
def debug; end
|
1340
|
+
|
1341
|
+
# source://puma//lib/puma/dsl.rb#152
|
1342
|
+
def default_host; end
|
1343
|
+
|
1344
|
+
# The directory to operate out of.
|
1345
|
+
#
|
1346
|
+
# The default is the current directory.
|
1347
|
+
#
|
1348
|
+
# @example
|
1349
|
+
# directory '/u/apps/lolcat'
|
1350
|
+
#
|
1351
|
+
# source://puma//lib/puma/dsl.rb#704
|
1352
|
+
def directory(dir); end
|
1353
|
+
|
1354
|
+
# When shutting down, drain the accept socket of pending connections and
|
1355
|
+
# process them. This loops over the accept socket until there are no more
|
1356
|
+
# read events and then stops looking and waits for the requests to finish.
|
1357
|
+
#
|
1358
|
+
# @see Puma::Server#graceful_shutdown
|
1359
|
+
#
|
1360
|
+
# source://puma//lib/puma/dsl.rb#336
|
1361
|
+
def drain_on_shutdown(which = T.unsafe(nil)); end
|
1362
|
+
|
1363
|
+
# source://puma//lib/puma/dsl.rb#441
|
1364
|
+
def early_hints(answer = T.unsafe(nil)); end
|
1365
|
+
|
1366
|
+
# Set the environment in which the rack's app will run. The value must be
|
1367
|
+
# a string.
|
1368
|
+
#
|
1369
|
+
# The default is "development".
|
1370
|
+
#
|
1371
|
+
# @example
|
1372
|
+
# environment 'production'
|
1373
|
+
#
|
1374
|
+
# source://puma//lib/puma/dsl.rb#347
|
1375
|
+
def environment(environment); end
|
1376
|
+
|
1377
|
+
# When using prune_bundler, if extra runtime dependencies need to be loaded to
|
1378
|
+
# initialize your app, then this setting can be used. This includes any Puma plugins.
|
1379
|
+
#
|
1380
|
+
# Before bundler is pruned, the gem names supplied will be looked up in the bundler
|
1381
|
+
# context and then loaded again after bundler is pruned.
|
1382
|
+
# Only applies if prune_bundler is used.
|
1383
|
+
#
|
1384
|
+
# @example
|
1385
|
+
# extra_runtime_dependencies ['gem_name_1', 'gem_name_2']
|
1386
|
+
# @example
|
1387
|
+
# extra_runtime_dependencies ['puma_worker_killer', 'puma-heroku']
|
1388
|
+
# @see Puma::Launcher#extra_runtime_deps_directories
|
1389
|
+
#
|
1390
|
+
# source://puma//lib/puma/dsl.rb#781
|
1391
|
+
def extra_runtime_dependencies(answer = T.unsafe(nil)); end
|
1392
|
+
|
1393
|
+
# Define how long the tcp socket stays open, if no data has been received.
|
1394
|
+
#
|
1395
|
+
# @see Puma::Server.new
|
1396
|
+
#
|
1397
|
+
# source://puma//lib/puma/dsl.rb#321
|
1398
|
+
def first_data_timeout(seconds); end
|
1399
|
+
|
1400
|
+
# How long to wait for threads to stop when shutting them
|
1401
|
+
# down. Defaults to :forever. Specifying :immediately will cause
|
1402
|
+
# Puma to kill the threads immediately. Otherwise the value
|
1403
|
+
# is the number of seconds to wait.
|
1404
|
+
#
|
1405
|
+
# Puma always waits a few seconds after killing a thread for it to try
|
1406
|
+
# to finish up it's work, even in :immediately mode.
|
1407
|
+
#
|
1408
|
+
# @see Puma::Server#graceful_shutdown
|
1409
|
+
#
|
1410
|
+
# source://puma//lib/puma/dsl.rb#359
|
1411
|
+
def force_shutdown_after(val = T.unsafe(nil)); end
|
1412
|
+
|
1413
|
+
# When enabled, workers will be forked from worker 0 instead of from the master process.
|
1414
|
+
# This option is similar to `preload_app` because the app is preloaded before forking,
|
1415
|
+
# but it is compatible with phased restart.
|
1416
|
+
#
|
1417
|
+
# This option also enables the `refork` command (SIGURG), which optimizes copy-on-write performance
|
1418
|
+
# in a running app.
|
1419
|
+
#
|
1420
|
+
# A refork will automatically trigger once after the specified number of requests
|
1421
|
+
# (default 1000), or pass 0 to disable auto refork.
|
1422
|
+
#
|
1423
|
+
# @note Cluster mode only.
|
1424
|
+
# @version 5.0.0
|
1425
|
+
#
|
1426
|
+
# source://puma//lib/puma/dsl.rb#988
|
1427
|
+
def fork_worker(after_requests = T.unsafe(nil)); end
|
1428
|
+
|
1429
|
+
# source://puma//lib/puma/dsl.rb#160
|
1430
|
+
def get(key, default = T.unsafe(nil)); end
|
1431
|
+
|
1432
|
+
# source://puma//lib/puma/dsl.rb#156
|
1433
|
+
def inject(&blk); end
|
1434
|
+
|
1435
|
+
# Specify the backend for the IO selector.
|
1436
|
+
#
|
1437
|
+
# Provided values will be passed directly to +NIO::Selector.new+, with the
|
1438
|
+
# exception of +:auto+ which will let nio4r choose the backend.
|
1439
|
+
#
|
1440
|
+
# Check the documentation of +NIO::Selector.backends+ for the list of valid
|
1441
|
+
# options. Note that the available options on your system will depend on the
|
1442
|
+
# operating system. If you want to use the pure Ruby backend (not
|
1443
|
+
# recommended due to its comparatively low performance), set environment
|
1444
|
+
# variable +NIO4R_PURE+ to +true+.
|
1445
|
+
#
|
1446
|
+
# The default is +:auto+.
|
1447
|
+
#
|
1448
|
+
# @see https://github.com/socketry/nio4r/blob/master/lib/nio/selector.rb
|
1449
|
+
#
|
1450
|
+
# source://puma//lib/puma/dsl.rb#1014
|
1451
|
+
def io_selector_backend(backend); end
|
1452
|
+
|
1453
|
+
# Load additional configuration from a file
|
1454
|
+
# Files get loaded later via Configuration#load
|
1455
|
+
#
|
1456
|
+
# source://puma//lib/puma/dsl.rb#238
|
1457
|
+
def load(file); end
|
1458
|
+
|
1459
|
+
# source://puma//lib/puma/dsl.rb#458
|
1460
|
+
def log_formatter(&block); end
|
1461
|
+
|
1462
|
+
# Enable request logging
|
1463
|
+
#
|
1464
|
+
# source://puma//lib/puma/dsl.rb#414
|
1465
|
+
def log_requests(which = T.unsafe(nil)); end
|
1466
|
+
|
1467
|
+
# Use +obj+ or +block+ as the low level error handler. This allows the
|
1468
|
+
# configuration file to change the default error on the server.
|
1469
|
+
#
|
1470
|
+
# @example
|
1471
|
+
# lowlevel_error_handler do |err|
|
1472
|
+
# [200, {}, ["error page"]]
|
1473
|
+
# end
|
1474
|
+
#
|
1475
|
+
# source://puma//lib/puma/dsl.rb#725
|
1476
|
+
def lowlevel_error_handler(obj = T.unsafe(nil), &block); end
|
1477
|
+
|
1478
|
+
# The number of requests to attempt inline before sending a client back to
|
1479
|
+
# the reactor to be subject to normal ordering.
|
1480
|
+
#
|
1481
|
+
# source://puma//lib/puma/dsl.rb#995
|
1482
|
+
def max_fast_inline(num_of_requests); end
|
1483
|
+
|
1484
|
+
# source://puma//lib/puma/dsl.rb#1018
|
1485
|
+
def mutate_stdout_and_stderr_to_sync_on_write(enabled = T.unsafe(nil)); end
|
1486
|
+
|
1487
|
+
# When `fork_worker` is enabled, code to run in Worker 0
|
1488
|
+
# before all other workers are re-forked from this process,
|
1489
|
+
# after the server has temporarily stopped serving requests
|
1490
|
+
# (once per complete refork cycle).
|
1491
|
+
#
|
1492
|
+
# This can be used to trigger extra garbage-collection to maximize
|
1493
|
+
# copy-on-write efficiency, or close any connections to remote servers
|
1494
|
+
# (database, Redis, ...) that were opened while the server was running.
|
1495
|
+
#
|
1496
|
+
# This can be called multiple times to add several hooks.
|
1497
|
+
#
|
1498
|
+
# @example
|
1499
|
+
# on_refork do
|
1500
|
+
# 3.times {GC.start}
|
1501
|
+
# end
|
1502
|
+
# @note Cluster mode with `fork_worker` enabled only.
|
1503
|
+
# @version 5.0.0
|
1504
|
+
#
|
1505
|
+
# source://puma//lib/puma/dsl.rb#681
|
1506
|
+
def on_refork(key = T.unsafe(nil), &block); end
|
1507
|
+
|
1508
|
+
# Code to run before doing a restart. This code should
|
1509
|
+
# close log files, database connections, etc.
|
1510
|
+
#
|
1511
|
+
# This can be called multiple times to add code each time.
|
1512
|
+
#
|
1513
|
+
# @example
|
1514
|
+
# on_restart do
|
1515
|
+
# puts 'On restart...'
|
1516
|
+
# end
|
1517
|
+
#
|
1518
|
+
# source://puma//lib/puma/dsl.rb#381
|
1519
|
+
def on_restart(&block); end
|
1520
|
+
|
1521
|
+
# Code to run in a worker when it boots to setup
|
1522
|
+
# the process before booting the app.
|
1523
|
+
#
|
1524
|
+
# This can be called multiple times to add several hooks.
|
1525
|
+
#
|
1526
|
+
# @example
|
1527
|
+
# on_worker_boot do
|
1528
|
+
# puts 'Before worker boot...'
|
1529
|
+
# end
|
1530
|
+
# @note Cluster mode only.
|
1531
|
+
#
|
1532
|
+
# source://puma//lib/puma/dsl.rb#613
|
1533
|
+
def on_worker_boot(key = T.unsafe(nil), &block); end
|
1534
|
+
|
1535
|
+
# Code to run in the master right before a worker is started. The worker's
|
1536
|
+
# index is passed as an argument.
|
1537
|
+
#
|
1538
|
+
# This can be called multiple times to add several hooks.
|
1539
|
+
#
|
1540
|
+
# @example
|
1541
|
+
# on_worker_fork do
|
1542
|
+
# puts 'Before worker fork...'
|
1543
|
+
# end
|
1544
|
+
# @note Cluster mode only.
|
1545
|
+
#
|
1546
|
+
# source://puma//lib/puma/dsl.rb#643
|
1547
|
+
def on_worker_fork(&block); end
|
1548
|
+
|
1549
|
+
# Code to run immediately before a worker shuts
|
1550
|
+
# down (after it has finished processing HTTP requests). These hooks
|
1551
|
+
# can block if necessary to wait for background operations unknown
|
1552
|
+
# to Puma to finish before the process terminates.
|
1553
|
+
#
|
1554
|
+
# This can be called multiple times to add several hooks.
|
1555
|
+
#
|
1556
|
+
# @example
|
1557
|
+
# on_worker_shutdown do
|
1558
|
+
# puts 'On worker shutdown...'
|
1559
|
+
# end
|
1560
|
+
# @note Cluster mode only.
|
1561
|
+
#
|
1562
|
+
# source://puma//lib/puma/dsl.rb#629
|
1563
|
+
def on_worker_shutdown(key = T.unsafe(nil), &block); end
|
1564
|
+
|
1565
|
+
# Code to run out-of-band when the worker is idle.
|
1566
|
+
# These hooks run immediately after a request has finished
|
1567
|
+
# processing and there are no busy threads on the worker.
|
1568
|
+
# The worker doesn't accept new requests until this code finishes.
|
1569
|
+
#
|
1570
|
+
# This hook is useful for running out-of-band garbage collection
|
1571
|
+
# or scheduling asynchronous tasks to execute after a response.
|
1572
|
+
#
|
1573
|
+
# This can be called multiple times to add several hooks.
|
1574
|
+
#
|
1575
|
+
# source://puma//lib/puma/dsl.rb#694
|
1576
|
+
def out_of_band(&block); end
|
1577
|
+
|
1578
|
+
# Define how long persistent connections can be idle before Puma closes them.
|
1579
|
+
#
|
1580
|
+
# @see Puma::Server.new
|
1581
|
+
#
|
1582
|
+
# source://puma//lib/puma/dsl.rb#315
|
1583
|
+
def persistent_timeout(seconds); end
|
1584
|
+
|
1585
|
+
# Store the pid of the server in the file at "path".
|
1586
|
+
#
|
1587
|
+
# @example
|
1588
|
+
# pidfile '/u/apps/lolcat/tmp/pids/puma.pid'
|
1589
|
+
#
|
1590
|
+
# source://puma//lib/puma/dsl.rb#400
|
1591
|
+
def pidfile(path); end
|
1592
|
+
|
1593
|
+
# Load the named plugin for use by this configuration
|
1594
|
+
#
|
1595
|
+
# source://puma//lib/puma/dsl.rb#166
|
1596
|
+
def plugin(name); end
|
1597
|
+
|
1598
|
+
# Define the TCP port to bind to. Use +bind+ for more advanced options.
|
1599
|
+
#
|
1600
|
+
# @example
|
1601
|
+
# port 9292
|
1602
|
+
#
|
1603
|
+
# source://puma//lib/puma/dsl.rb#308
|
1604
|
+
def port(port, host = T.unsafe(nil)); end
|
1605
|
+
|
1606
|
+
# Preload the application before starting the workers; this conflicts with
|
1607
|
+
# phased restart feature. On by default if your app uses more than 1 worker.
|
1608
|
+
#
|
1609
|
+
# @example
|
1610
|
+
# preload_app!
|
1611
|
+
# @note Cluster mode only.
|
1612
|
+
#
|
1613
|
+
# source://puma//lib/puma/dsl.rb#714
|
1614
|
+
def preload_app!(answer = T.unsafe(nil)); end
|
1615
|
+
|
1616
|
+
# This option is used to allow your app and its gems to be
|
1617
|
+
# properly reloaded when not using preload.
|
1618
|
+
#
|
1619
|
+
# When set, if Puma detects that it's been invoked in the
|
1620
|
+
# context of Bundler, it will cleanup the environment and
|
1621
|
+
# re-run itself outside the Bundler environment, but directly
|
1622
|
+
# using the files that Bundler has setup.
|
1623
|
+
#
|
1624
|
+
# This means that Puma is now decoupled from your Bundler
|
1625
|
+
# context and when each worker loads, it will be loading a
|
1626
|
+
# new Bundler context and thus can float around as the release
|
1627
|
+
# dictates.
|
1628
|
+
#
|
1629
|
+
# @note This is incompatible with +preload_app!+.
|
1630
|
+
# @note This is only supported for RubyGems 2.2+
|
1631
|
+
# @see extra_runtime_dependencies
|
1632
|
+
#
|
1633
|
+
# source://puma//lib/puma/dsl.rb#748
|
1634
|
+
def prune_bundler(answer = T.unsafe(nil)); end
|
1635
|
+
|
1636
|
+
# When set to true (the default), workers accept all requests
|
1637
|
+
# and queue them before passing them to the handlers.
|
1638
|
+
# When set to false, each worker process accepts exactly as
|
1639
|
+
# many requests as it is configured to simultaneously handle.
|
1640
|
+
#
|
1641
|
+
# Queueing requests generally improves performance. In some
|
1642
|
+
# cases, such as a single threaded application, it may be
|
1643
|
+
# better to ensure requests get balanced across workers.
|
1644
|
+
#
|
1645
|
+
# Note that setting this to false disables HTTP keepalive and
|
1646
|
+
# slow clients will occupy a handler thread while the request
|
1647
|
+
# is being sent. A reverse proxy, such as nginx, can handle
|
1648
|
+
# slow clients and queue requests before they reach Puma.
|
1649
|
+
#
|
1650
|
+
# @see Puma::Server
|
1651
|
+
#
|
1652
|
+
# source://puma//lib/puma/dsl.rb#895
|
1653
|
+
def queue_requests(answer = T.unsafe(nil)); end
|
1654
|
+
|
1655
|
+
# Disable request logging, if this isn't used it'll be enabled by default.
|
1656
|
+
#
|
1657
|
+
# @example
|
1658
|
+
# quiet
|
1659
|
+
#
|
1660
|
+
# source://puma//lib/puma/dsl.rb#408
|
1661
|
+
def quiet(which = T.unsafe(nil)); end
|
1662
|
+
|
1663
|
+
# Allows setting `env['rack.url_scheme']`.
|
1664
|
+
# Only necessary if X-Forwarded-Proto is not being set by your proxy
|
1665
|
+
# Normal values are 'http' or 'https'.
|
1666
|
+
#
|
1667
|
+
# source://puma//lib/puma/dsl.rb#437
|
1668
|
+
def rack_url_scheme(scheme = T.unsafe(nil)); end
|
1669
|
+
|
1670
|
+
# Load +path+ as a rackup file.
|
1671
|
+
#
|
1672
|
+
# The default is "config.ru".
|
1673
|
+
#
|
1674
|
+
# @example
|
1675
|
+
# rackup '/u/apps/lolcat/config.ru'
|
1676
|
+
#
|
1677
|
+
# source://puma//lib/puma/dsl.rb#430
|
1678
|
+
def rackup(path); end
|
1679
|
+
|
1680
|
+
# By default, Puma will raise SignalException when SIGTERM is received. In
|
1681
|
+
# environments where SIGTERM is something expected, you can suppress these
|
1682
|
+
# with this option.
|
1683
|
+
#
|
1684
|
+
# This can be useful for example in Kubernetes, where rolling restart is
|
1685
|
+
# guaranteed usually on infrastructure level.
|
1686
|
+
#
|
1687
|
+
# @example
|
1688
|
+
# raise_exception_on_sigterm false
|
1689
|
+
# @see Puma::Launcher#setup_signals
|
1690
|
+
# @see Puma::Cluster#setup_signals
|
1691
|
+
#
|
1692
|
+
# source://puma//lib/puma/dsl.rb#764
|
1693
|
+
def raise_exception_on_sigterm(answer = T.unsafe(nil)); end
|
1694
|
+
|
1695
|
+
# Command to use to restart Puma. This should be just how to
|
1696
|
+
# load Puma itself (ie. 'ruby -Ilib bin/puma'), not the arguments
|
1697
|
+
# to Puma, as those are the same as the original process.
|
1698
|
+
#
|
1699
|
+
# @example
|
1700
|
+
# restart_command '/u/app/lolcat/bin/restart_puma'
|
1701
|
+
#
|
1702
|
+
# source://puma//lib/puma/dsl.rb#392
|
1703
|
+
def restart_command(cmd); end
|
1704
|
+
|
1705
|
+
# source://puma//lib/puma/dsl.rb#148
|
1706
|
+
def set_default_host(host); end
|
1707
|
+
|
1708
|
+
# Control how the remote address of the connection is set. This
|
1709
|
+
# is configurable because to calculate the true socket peer address
|
1710
|
+
# a kernel syscall is required which for very fast rack handlers
|
1711
|
+
# slows down the handling significantly.
|
1712
|
+
#
|
1713
|
+
# There are 5 possible values:
|
1714
|
+
#
|
1715
|
+
# 1. **:socket** (the default) - read the peername from the socket using the
|
1716
|
+
# syscall. This is the normal behavior. If this fails for any reason (e.g.,
|
1717
|
+
# if the peer disconnects between the connection being accepted and the getpeername
|
1718
|
+
# system call), Puma will return "0.0.0.0"
|
1719
|
+
# 2. **:localhost** - set the remote address to "127.0.0.1"
|
1720
|
+
# 3. **header: <http_header>**- set the remote address to the value of the
|
1721
|
+
# provided http header. For instance:
|
1722
|
+
# `set_remote_address header: "X-Real-IP"`.
|
1723
|
+
# Only the first word (as separated by spaces or comma) is used, allowing
|
1724
|
+
# headers such as X-Forwarded-For to be used as well. If this header is absent,
|
1725
|
+
# Puma will fall back to the behavior of :socket
|
1726
|
+
# 4. **proxy_protocol: :v1**- set the remote address to the value read from the
|
1727
|
+
# HAproxy PROXY protocol, version 1. If the request does not have the PROXY
|
1728
|
+
# protocol attached to it, will fall back to :socket
|
1729
|
+
# 5. **\<Any string\>** - this allows you to hardcode remote address to any value
|
1730
|
+
# you wish. Because Puma never uses this field anyway, it's format is
|
1731
|
+
# entirely in your hands.
|
1732
|
+
#
|
1733
|
+
# source://puma//lib/puma/dsl.rb#946
|
1734
|
+
def set_remote_address(val = T.unsafe(nil)); end
|
1735
|
+
|
1736
|
+
# When a shutdown is requested, the backtraces of all the
|
1737
|
+
# threads will be written to $stdout. This can help figure
|
1738
|
+
# out why shutdown is hanging.
|
1739
|
+
#
|
1740
|
+
# source://puma//lib/puma/dsl.rb#903
|
1741
|
+
def shutdown_debug(val = T.unsafe(nil)); end
|
1742
|
+
|
1743
|
+
# Disable warning message when running in cluster mode with a single worker.
|
1744
|
+
#
|
1745
|
+
# Cluster mode has some overhead of running an additional 'control' process
|
1746
|
+
# in order to manage the cluster. If only running a single worker it is
|
1747
|
+
# likely not worth paying that overhead vs running in single mode with
|
1748
|
+
# additional threads instead.
|
1749
|
+
#
|
1750
|
+
# There are some scenarios where running cluster mode with a single worker
|
1751
|
+
# may still be warranted and valid under certain deployment scenarios, see
|
1752
|
+
# https://github.com/puma/puma/issues/2534
|
1753
|
+
#
|
1754
|
+
# Moving from workers = 1 to workers = 0 will save 10-30% of memory use.
|
1755
|
+
#
|
1756
|
+
# @note Cluster mode only.
|
1757
|
+
#
|
1758
|
+
# source://puma//lib/puma/dsl.rb#580
|
1759
|
+
def silence_single_worker_warning; end
|
1760
|
+
|
1761
|
+
# Instead of using +bind+ and manually constructing a URI like:
|
1762
|
+
#
|
1763
|
+
# bind 'ssl://127.0.0.1:9292?key=key_path&cert=cert_path'
|
1764
|
+
#
|
1765
|
+
# you can use the this method.
|
1766
|
+
#
|
1767
|
+
# When binding on localhost you don't need to specify +cert+ and +key+,
|
1768
|
+
# Puma will assume you are using the +localhost+ gem and try to load the
|
1769
|
+
# appropriate files.
|
1770
|
+
#
|
1771
|
+
# When using the options hash parameter, the `reuse:` value is either
|
1772
|
+
# `true`, which sets reuse 'on' with default values, or a hash, with `:size`
|
1773
|
+
# and/or `:timeout` keys, each with integer values.
|
1774
|
+
#
|
1775
|
+
# @example
|
1776
|
+
# ssl_bind '127.0.0.1', '9292', {
|
1777
|
+
# cert: path_to_cert,
|
1778
|
+
# key: path_to_key,
|
1779
|
+
# ssl_cipher_filter: cipher_filter, # optional
|
1780
|
+
# verify_mode: verify_mode, # default 'none'
|
1781
|
+
# verification_flags: flags, # optional, not supported by JRuby
|
1782
|
+
# reuse: true # optional
|
1783
|
+
# }
|
1784
|
+
# @example Using self-signed certificate with the +localhost+ gem:
|
1785
|
+
# ssl_bind '127.0.0.1', '9292'
|
1786
|
+
# @example Alternatively, you can provide +cert_pem+ and +key_pem+:
|
1787
|
+
# ssl_bind '127.0.0.1', '9292', {
|
1788
|
+
# cert_pem: File.read(path_to_cert),
|
1789
|
+
# key_pem: File.read(path_to_key),
|
1790
|
+
# reuse: {size: 2_000, timeout: 20} # optional
|
1791
|
+
# }
|
1792
|
+
# @example For JRuby, two keys are required: +keystore+ & +keystore_pass+
|
1793
|
+
# ssl_bind '127.0.0.1', '9292', {
|
1794
|
+
# keystore: path_to_keystore,
|
1795
|
+
# keystore_pass: password,
|
1796
|
+
# ssl_cipher_list: cipher_list, # optional
|
1797
|
+
# verify_mode: verify_mode # default 'none'
|
1798
|
+
# }
|
1799
|
+
#
|
1800
|
+
# source://puma//lib/puma/dsl.rb#530
|
1801
|
+
def ssl_bind(host, port, opts = T.unsafe(nil)); end
|
1802
|
+
|
1803
|
+
# Use +path+ as the file to store the server info state. This is
|
1804
|
+
# used by +pumactl+ to query and control the server.
|
1805
|
+
#
|
1806
|
+
# @example
|
1807
|
+
# state_path '/u/apps/lolcat/tmp/pids/puma.state'
|
1808
|
+
#
|
1809
|
+
# source://puma//lib/puma/dsl.rb#540
|
1810
|
+
def state_path(path); end
|
1811
|
+
|
1812
|
+
# Use +permission+ to restrict permissions for the state file.
|
1813
|
+
#
|
1814
|
+
# @example
|
1815
|
+
# state_permission 0600
|
1816
|
+
# @version 5.0.0
|
1817
|
+
#
|
1818
|
+
# source://puma//lib/puma/dsl.rb#550
|
1819
|
+
def state_permission(permission); end
|
1820
|
+
|
1821
|
+
# Redirect +STDOUT+ and +STDERR+ to files specified. The +append+ parameter
|
1822
|
+
# specifies whether the output is appended, the default is +false+.
|
1823
|
+
#
|
1824
|
+
# @example
|
1825
|
+
# stdout_redirect '/app/lolcat/log/stdout', '/app/lolcat/log/stderr'
|
1826
|
+
# @example
|
1827
|
+
# stdout_redirect '/app/lolcat/log/stdout', '/app/lolcat/log/stderr', true
|
1828
|
+
#
|
1829
|
+
# source://puma//lib/puma/dsl.rb#452
|
1830
|
+
def stdout_redirect(stdout = T.unsafe(nil), stderr = T.unsafe(nil), append = T.unsafe(nil)); end
|
1831
|
+
|
1832
|
+
# Additional text to display in process listing.
|
1833
|
+
#
|
1834
|
+
# If you do not specify a tag, Puma will infer it. If you do not want Puma
|
1835
|
+
# to add a tag, use an empty string.
|
1836
|
+
#
|
1837
|
+
# @example
|
1838
|
+
# tag 'app name'
|
1839
|
+
# @example
|
1840
|
+
# tag ''
|
1841
|
+
#
|
1842
|
+
# source://puma//lib/puma/dsl.rb#794
|
1843
|
+
def tag(string); end
|
1844
|
+
|
1845
|
+
# Configure +min+ to be the minimum number of threads to use to answer
|
1846
|
+
# requests and +max+ the maximum.
|
1847
|
+
#
|
1848
|
+
# The default is the environment variables +PUMA_MIN_THREADS+ / +PUMA_MAX_THREADS+
|
1849
|
+
# (or +MIN_THREADS+ / +MAX_THREADS+ if the +PUMA_+ variables aren't set).
|
1850
|
+
#
|
1851
|
+
# If these environment variables aren't set, the default is "0, 5" in MRI or "0, 16" for other interpreters.
|
1852
|
+
#
|
1853
|
+
# @example
|
1854
|
+
# threads 0, 16
|
1855
|
+
# @example
|
1856
|
+
# threads 5, 5
|
1857
|
+
#
|
1858
|
+
# source://puma//lib/puma/dsl.rb#474
|
1859
|
+
def threads(min, max); end
|
1860
|
+
|
1861
|
+
# Attempts to route traffic to less-busy workers by causing them to delay
|
1862
|
+
# listening on the socket, allowing workers which are not processing any
|
1863
|
+
# requests to pick up new requests first.
|
1864
|
+
#
|
1865
|
+
# Only works on MRI. For all other interpreters, this setting does nothing.
|
1866
|
+
#
|
1867
|
+
# @see Puma::Server#handle_servers
|
1868
|
+
# @see Puma::ThreadPool#wait_for_less_busy_worker
|
1869
|
+
# @version 5.0.0
|
1870
|
+
#
|
1871
|
+
# source://puma//lib/puma/dsl.rb#917
|
1872
|
+
def wait_for_less_busy_worker(val = T.unsafe(nil)); end
|
1873
|
+
|
1874
|
+
# Change the default worker timeout for booting.
|
1875
|
+
#
|
1876
|
+
# If unspecified, this defaults to the value of worker_timeout.
|
1877
|
+
#
|
1878
|
+
# @example
|
1879
|
+
# worker_boot_timeout 60
|
1880
|
+
# @note Cluster mode only.
|
1881
|
+
# @see Puma::Cluster::Worker#ping_timeout
|
1882
|
+
#
|
1883
|
+
# source://puma//lib/puma/dsl.rb#844
|
1884
|
+
def worker_boot_timeout(timeout); end
|
1885
|
+
|
1886
|
+
# Change the default interval for checking workers.
|
1887
|
+
#
|
1888
|
+
# The default value is 5 seconds.
|
1889
|
+
#
|
1890
|
+
# @example
|
1891
|
+
# worker_check_interval 5
|
1892
|
+
# @note Cluster mode only.
|
1893
|
+
# @see Puma::Cluster#check_workers
|
1894
|
+
#
|
1895
|
+
# source://puma//lib/puma/dsl.rb#807
|
1896
|
+
def worker_check_interval(interval); end
|
1897
|
+
|
1898
|
+
# Set the strategy for worker culling.
|
1899
|
+
#
|
1900
|
+
# There are two possible values:
|
1901
|
+
#
|
1902
|
+
# 1. **:youngest** - the youngest workers (i.e. the workers that were
|
1903
|
+
# the most recently started) will be culled.
|
1904
|
+
# 2. **:oldest** - the oldest workers (i.e. the workers that were started
|
1905
|
+
# the longest time ago) will be culled.
|
1906
|
+
#
|
1907
|
+
# @example
|
1908
|
+
# worker_culling_strategy :oldest
|
1909
|
+
# @note Cluster mode only.
|
1910
|
+
# @see Puma::Cluster#cull_workers
|
1911
|
+
#
|
1912
|
+
# source://puma//lib/puma/dsl.rb#871
|
1913
|
+
def worker_culling_strategy(strategy); end
|
1914
|
+
|
1915
|
+
# Set the timeout for worker shutdown.
|
1916
|
+
#
|
1917
|
+
# @note Cluster mode only.
|
1918
|
+
# @see Puma::Cluster::Worker#term
|
1919
|
+
#
|
1920
|
+
# source://puma//lib/puma/dsl.rb#853
|
1921
|
+
def worker_shutdown_timeout(timeout); end
|
1922
|
+
|
1923
|
+
# Verifies that all workers have checked in to the master process within
|
1924
|
+
# the given timeout. If not the worker process will be restarted. This is
|
1925
|
+
# not a request timeout, it is to protect against a hung or dead process.
|
1926
|
+
# Setting this value will not protect against slow requests.
|
1927
|
+
#
|
1928
|
+
# The minimum value is 6 seconds, the default value is 60 seconds.
|
1929
|
+
#
|
1930
|
+
# @example
|
1931
|
+
# worker_timeout 60
|
1932
|
+
# @note Cluster mode only.
|
1933
|
+
# @see Puma::Cluster::Worker#ping_timeout
|
1934
|
+
#
|
1935
|
+
# source://puma//lib/puma/dsl.rb#823
|
1936
|
+
def worker_timeout(timeout); end
|
1937
|
+
|
1938
|
+
# How many worker processes to run. Typically this is set to
|
1939
|
+
# the number of available cores.
|
1940
|
+
#
|
1941
|
+
# The default is the value of the environment variable +WEB_CONCURRENCY+ if
|
1942
|
+
# set, otherwise 0.
|
1943
|
+
#
|
1944
|
+
# @note Cluster mode only.
|
1945
|
+
# @see Puma::Cluster
|
1946
|
+
#
|
1947
|
+
# source://puma//lib/puma/dsl.rb#562
|
1948
|
+
def workers(count); end
|
1949
|
+
|
1950
|
+
private
|
1951
|
+
|
1952
|
+
# To avoid adding cert_pem and key_pem as URI params, we store them on the
|
1953
|
+
# options[:store] from where Puma binder knows how to find and extract them.
|
1954
|
+
#
|
1955
|
+
# source://puma//lib/puma/dsl.rb#1026
|
1956
|
+
def add_pem_values_to_options_store(opts); end
|
1957
|
+
|
1958
|
+
# source://puma//lib/puma/dsl.rb#1042
|
1959
|
+
def process_hook(options_key, key, block, meth); end
|
1960
|
+
|
1961
|
+
class << self
|
1962
|
+
# convenience method so logic can be used in CI
|
1963
|
+
#
|
1964
|
+
# @see ssl_bind
|
1965
|
+
#
|
1966
|
+
# source://puma//lib/puma/dsl.rb#57
|
1967
|
+
def ssl_bind_str(host, port, opts); end
|
1968
|
+
end
|
1969
|
+
end
|
1970
|
+
|
1971
|
+
# source://puma//lib/puma/dsl.rb#52
|
1972
|
+
Puma::DSL::ON_WORKER_KEY = T.let(T.unsafe(nil), Array)
|
1973
|
+
|
1974
|
+
# The implementation of a detailed error logging.
|
1975
|
+
#
|
1976
|
+
# @version 5.0.0
|
1977
|
+
class Puma::ErrorLogger
|
1978
|
+
include ::Puma::Const
|
1979
|
+
|
1980
|
+
# @return [ErrorLogger] a new instance of ErrorLogger
|
1981
|
+
#
|
1982
|
+
# source://puma//lib/puma/error_logger.rb#18
|
1983
|
+
def initialize(ioerr); end
|
1984
|
+
|
1985
|
+
# Print occurred error details only if
|
1986
|
+
# environment variable PUMA_DEBUG is defined.
|
1987
|
+
# +options+ hash with additional options:
|
1988
|
+
# - +error+ is an exception object
|
1989
|
+
# - +req+ the http request
|
1990
|
+
# - +text+ (default nil) custom string to print in title
|
1991
|
+
# and before all remaining info.
|
1992
|
+
#
|
1993
|
+
# source://puma//lib/puma/error_logger.rb#47
|
1994
|
+
def debug(options = T.unsafe(nil)); end
|
1995
|
+
|
1996
|
+
# Print occurred error details.
|
1997
|
+
# +options+ hash with additional options:
|
1998
|
+
# - +error+ is an exception object
|
1999
|
+
# - +req+ the http request
|
2000
|
+
# - +text+ (default nil) custom string to print in title
|
2001
|
+
# and before all remaining info.
|
2002
|
+
#
|
2003
|
+
# source://puma//lib/puma/error_logger.rb#35
|
2004
|
+
def info(options = T.unsafe(nil)); end
|
2005
|
+
|
2006
|
+
# Returns the value of attribute ioerr.
|
2007
|
+
#
|
2008
|
+
# source://puma//lib/puma/error_logger.rb#12
|
2009
|
+
def ioerr; end
|
2010
|
+
|
2011
|
+
# source://puma//lib/puma/error_logger.rb#73
|
2012
|
+
def request_dump(req); end
|
2013
|
+
|
2014
|
+
# source://puma//lib/puma/error_logger.rb#89
|
2015
|
+
def request_headers(req); end
|
2016
|
+
|
2017
|
+
# @return [Boolean]
|
2018
|
+
#
|
2019
|
+
# source://puma//lib/puma/error_logger.rb#94
|
2020
|
+
def request_parsed?(req); end
|
2021
|
+
|
2022
|
+
# source://puma//lib/puma/error_logger.rb#78
|
2023
|
+
def request_title(req); end
|
2024
|
+
|
2025
|
+
# source://puma//lib/puma/error_logger.rb#61
|
2026
|
+
def title(options = T.unsafe(nil)); end
|
2027
|
+
|
2028
|
+
private
|
2029
|
+
|
2030
|
+
# source://puma//lib/puma/error_logger.rb#98
|
2031
|
+
def internal_write(str); end
|
2032
|
+
|
2033
|
+
class << self
|
2034
|
+
# source://puma//lib/puma/error_logger.rb#24
|
2035
|
+
def stdio; end
|
2036
|
+
end
|
2037
|
+
end
|
2038
|
+
|
2039
|
+
# source://puma//lib/puma/error_logger.rb#16
|
2040
|
+
Puma::ErrorLogger::LOG_QUEUE = T.let(T.unsafe(nil), Thread::Queue)
|
2041
|
+
|
2042
|
+
# source://puma//lib/puma/error_logger.rb#14
|
2043
|
+
Puma::ErrorLogger::REQUEST_FORMAT = T.let(T.unsafe(nil), String)
|
2044
|
+
|
2045
|
+
# This is an event sink used by `Puma::Server` to handle
|
2046
|
+
# lifecycle events such as :on_booted, :on_restart, and :on_stopped.
|
2047
|
+
# Using `Puma::DSL` it is possible to register callback hooks
|
2048
|
+
# for each event type.
|
2049
|
+
class Puma::Events
|
2050
|
+
# @return [Events] a new instance of Events
|
2051
|
+
#
|
2052
|
+
# source://puma//lib/puma/events.rb#11
|
2053
|
+
def initialize; end
|
2054
|
+
|
2055
|
+
# Fire callbacks for the named hook
|
2056
|
+
#
|
2057
|
+
# source://puma//lib/puma/events.rb#16
|
2058
|
+
def fire(hook, *args); end
|
2059
|
+
|
2060
|
+
# source://puma//lib/puma/events.rb#45
|
2061
|
+
def fire_on_booted!; end
|
2062
|
+
|
2063
|
+
# source://puma//lib/puma/events.rb#49
|
2064
|
+
def fire_on_restart!; end
|
2065
|
+
|
2066
|
+
# source://puma//lib/puma/events.rb#53
|
2067
|
+
def fire_on_stopped!; end
|
2068
|
+
|
2069
|
+
# source://puma//lib/puma/events.rb#33
|
2070
|
+
def on_booted(&block); end
|
2071
|
+
|
2072
|
+
# source://puma//lib/puma/events.rb#37
|
2073
|
+
def on_restart(&block); end
|
2074
|
+
|
2075
|
+
# source://puma//lib/puma/events.rb#41
|
2076
|
+
def on_stopped(&block); end
|
2077
|
+
|
2078
|
+
# Register a callback for a given hook
|
2079
|
+
#
|
2080
|
+
# source://puma//lib/puma/events.rb#21
|
2081
|
+
def register(hook, obj = T.unsafe(nil), &blk); end
|
2082
|
+
end
|
2083
|
+
|
2084
|
+
# @version 5.2.1
|
2085
|
+
#
|
2086
|
+
# source://puma//lib/puma/detect.rb#9
|
2087
|
+
Puma::HAS_FORK = T.let(T.unsafe(nil), TrueClass)
|
2088
|
+
|
2089
|
+
# source://puma//lib/puma/detect.rb#11
|
2090
|
+
Puma::HAS_NATIVE_IO_WAIT = T.let(T.unsafe(nil), TrueClass)
|
2091
|
+
|
2092
|
+
# at present, MiniSSL::Engine is only defined in extension code (puma_http11),
|
2093
|
+
# not in minissl.rb
|
2094
|
+
#
|
2095
|
+
# source://puma//lib/puma.rb#29
|
2096
|
+
Puma::HAS_SSL = T.let(T.unsafe(nil), TrueClass)
|
2097
|
+
|
2098
|
+
# source://puma//lib/puma.rb#31
|
2099
|
+
Puma::HAS_UNIX_SOCKET = T.let(T.unsafe(nil), TrueClass)
|
2100
|
+
|
2101
|
+
# Every standard HTTP code mapped to the appropriate message.
|
2102
|
+
# Generated with:
|
2103
|
+
# curl -s https://www.iana.org/assignments/http-status-codes/http-status-codes-1.csv | \
|
2104
|
+
# ruby -ne 'm = /^(\d{3}),(?!Unassigned|\(Unused\))([^,]+)/.match($_) and \
|
2105
|
+
# puts "#{m[1]} => \x27#{m[2].strip}\x27,"'
|
2106
|
+
#
|
2107
|
+
# source://puma//lib/puma/const.rb#18
|
2108
|
+
Puma::HTTP_STATUS_CODES = T.let(T.unsafe(nil), Hash)
|
2109
|
+
|
2110
|
+
class Puma::HttpParser
|
2111
|
+
def initialize; end
|
2112
|
+
|
2113
|
+
def body; end
|
2114
|
+
def error?; end
|
2115
|
+
def execute(_arg0, _arg1, _arg2); end
|
2116
|
+
def finish; end
|
2117
|
+
def finished?; end
|
2118
|
+
def nread; end
|
2119
|
+
def reset; end
|
2120
|
+
end
|
2121
|
+
|
2122
|
+
class Puma::HttpParserError < ::IOError; end
|
2123
|
+
class Puma::HttpParserError501 < ::IOError; end
|
2124
|
+
|
2125
|
+
class Puma::IOBuffer < ::StringIO
|
2126
|
+
# @return [IOBuffer] a new instance of IOBuffer
|
2127
|
+
#
|
2128
|
+
# source://puma//lib/puma/io_buffer.rb#7
|
2129
|
+
def initialize; end
|
2130
|
+
|
2131
|
+
def append(*_arg0); end
|
2132
|
+
|
2133
|
+
# source://puma//lib/puma/io_buffer.rb#15
|
2134
|
+
def clear; end
|
2135
|
+
|
2136
|
+
# @return [Boolean]
|
2137
|
+
#
|
2138
|
+
# source://puma//lib/puma/io_buffer.rb#11
|
2139
|
+
def empty?; end
|
2140
|
+
|
2141
|
+
# source://puma//lib/puma/io_buffer.rb#15
|
2142
|
+
def reset; end
|
2143
|
+
|
2144
|
+
# source://puma//lib/puma/io_buffer.rb#20
|
2145
|
+
def to_s; end
|
2146
|
+
end
|
2147
|
+
|
2148
|
+
# source://puma//lib/puma/detect.rb#13
|
2149
|
+
Puma::IS_JRUBY = T.let(T.unsafe(nil), FalseClass)
|
2150
|
+
|
2151
|
+
# @version 5.2.0
|
2152
|
+
#
|
2153
|
+
# source://puma//lib/puma/detect.rb#21
|
2154
|
+
Puma::IS_MRI = T.let(T.unsafe(nil), TrueClass)
|
2155
|
+
|
2156
|
+
# source://puma//lib/puma/detect.rb#15
|
2157
|
+
Puma::IS_OSX = T.let(T.unsafe(nil), TrueClass)
|
2158
|
+
|
2159
|
+
# source://puma//lib/puma/detect.rb#17
|
2160
|
+
Puma::IS_WINDOWS = T.let(T.unsafe(nil), FalseClass)
|
2161
|
+
|
2162
|
+
# Puma deliberately avoids the use of the json gem and instead performs JSON
|
2163
|
+
# serialization without any external dependencies. In a puma cluster, loading
|
2164
|
+
# any gem into the puma master process means that operators cannot use a
|
2165
|
+
# phased restart to upgrade their application if the new version of that
|
2166
|
+
# application uses a different version of that gem. The json gem in
|
2167
|
+
# particular is additionally problematic because it leverages native
|
2168
|
+
# extensions. If the puma master process relies on a gem with native
|
2169
|
+
# extensions and operators remove gems from disk related to old releases,
|
2170
|
+
# subsequent phased restarts can fail.
|
2171
|
+
#
|
2172
|
+
# The implementation of JSON serialization in this module is not designed to
|
2173
|
+
# be particularly full-featured or fast. It just has to handle the few places
|
2174
|
+
# where Puma relies on JSON serialization internally.
|
2175
|
+
module Puma::JSONSerialization
|
2176
|
+
class << self
|
2177
|
+
# source://puma//lib/puma/json_serialization.rb#29
|
2178
|
+
def generate(value); end
|
2179
|
+
|
2180
|
+
private
|
2181
|
+
|
2182
|
+
# source://puma//lib/puma/json_serialization.rb#86
|
2183
|
+
def serialize_object_key(output, value); end
|
2184
|
+
|
2185
|
+
# source://puma//lib/puma/json_serialization.rb#71
|
2186
|
+
def serialize_string(output, value); end
|
2187
|
+
|
2188
|
+
# source://puma//lib/puma/json_serialization.rb#38
|
2189
|
+
def serialize_value(output, value); end
|
2190
|
+
end
|
2191
|
+
end
|
2192
|
+
|
2193
|
+
# source://puma//lib/puma/json_serialization.rb#22
|
2194
|
+
Puma::JSONSerialization::BACKSLASH = T.let(T.unsafe(nil), Regexp)
|
2195
|
+
|
2196
|
+
# source://puma//lib/puma/json_serialization.rb#24
|
2197
|
+
Puma::JSONSerialization::CHAR_TO_ESCAPE = T.let(T.unsafe(nil), Regexp)
|
2198
|
+
|
2199
|
+
# As required by ECMA-404
|
2200
|
+
#
|
2201
|
+
# source://puma//lib/puma/json_serialization.rb#23
|
2202
|
+
Puma::JSONSerialization::CONTROL_CHAR_TO_ESCAPE = T.let(T.unsafe(nil), Regexp)
|
2203
|
+
|
2204
|
+
# source://puma//lib/puma/json_serialization.rb#21
|
2205
|
+
Puma::JSONSerialization::QUOTE = T.let(T.unsafe(nil), Regexp)
|
2206
|
+
|
2207
|
+
class Puma::JSONSerialization::SerializationError < ::StandardError; end
|
2208
|
+
|
2209
|
+
# Puma::Launcher is the single entry point for starting a Puma server based on user
|
2210
|
+
# configuration. It is responsible for taking user supplied arguments and resolving them
|
2211
|
+
# with configuration in `config/puma.rb` or `config/puma/<env>.rb`.
|
2212
|
+
#
|
2213
|
+
# It is responsible for either launching a cluster of Puma workers or a single
|
2214
|
+
# puma server.
|
2215
|
+
class Puma::Launcher
|
2216
|
+
# Returns an instance of Launcher
|
2217
|
+
#
|
2218
|
+
# +conf+ A Puma::Configuration object indicating how to run the server.
|
2219
|
+
#
|
2220
|
+
# +launcher_args+ A Hash that currently has one required key `:events`,
|
2221
|
+
# this is expected to hold an object similar to an `Puma::LogWriter.stdio`,
|
2222
|
+
# this object will be responsible for broadcasting Puma's internal state
|
2223
|
+
# to a logging destination. An optional key `:argv` can be supplied,
|
2224
|
+
# this should be an array of strings, these arguments are re-used when
|
2225
|
+
# restarting the puma server.
|
2226
|
+
#
|
2227
|
+
# Examples:
|
2228
|
+
#
|
2229
|
+
# conf = Puma::Configuration.new do |user_config|
|
2230
|
+
# user_config.threads 1, 10
|
2231
|
+
# user_config.app do |env|
|
2232
|
+
# [200, {}, ["hello world"]]
|
2233
|
+
# end
|
2234
|
+
# end
|
2235
|
+
# Puma::Launcher.new(conf, log_writer: Puma::LogWriter.stdio).run
|
2236
|
+
#
|
2237
|
+
# @return [Launcher] a new instance of Launcher
|
2238
|
+
#
|
2239
|
+
# source://puma//lib/puma/launcher.rb#41
|
2240
|
+
def initialize(conf, launcher_args = T.unsafe(nil)); end
|
2241
|
+
|
2242
|
+
# Returns the value of attribute binder.
|
2243
|
+
#
|
2244
|
+
# source://puma//lib/puma/launcher.rb#102
|
2245
|
+
def binder; end
|
2246
|
+
|
2247
|
+
# source://puma//lib/puma/launcher.rb#208
|
2248
|
+
def close_binder_listeners; end
|
2249
|
+
|
2250
|
+
# Returns the value of attribute config.
|
2251
|
+
#
|
2252
|
+
# source://puma//lib/puma/launcher.rb#102
|
2253
|
+
def config; end
|
2254
|
+
|
2255
|
+
# Return all tcp ports the launcher may be using, TCP or SSL
|
2256
|
+
#
|
2257
|
+
# @version 5.0.0
|
2258
|
+
#
|
2259
|
+
# source://puma//lib/puma/launcher.rb#194
|
2260
|
+
def connected_ports; end
|
2261
|
+
|
2262
|
+
# Delete the configured pidfile
|
2263
|
+
#
|
2264
|
+
# source://puma//lib/puma/launcher.rb#130
|
2265
|
+
def delete_pidfile; end
|
2266
|
+
|
2267
|
+
# Returns the value of attribute events.
|
2268
|
+
#
|
2269
|
+
# source://puma//lib/puma/launcher.rb#102
|
2270
|
+
def events; end
|
2271
|
+
|
2272
|
+
# Begin async shutdown of the server
|
2273
|
+
#
|
2274
|
+
# source://puma//lib/puma/launcher.rb#136
|
2275
|
+
def halt; end
|
2276
|
+
|
2277
|
+
# Returns the value of attribute log_writer.
|
2278
|
+
#
|
2279
|
+
# source://puma//lib/puma/launcher.rb#102
|
2280
|
+
def log_writer; end
|
2281
|
+
|
2282
|
+
# Returns the value of attribute options.
|
2283
|
+
#
|
2284
|
+
# source://puma//lib/puma/launcher.rb#102
|
2285
|
+
def options; end
|
2286
|
+
|
2287
|
+
# Begin a phased restart if supported
|
2288
|
+
#
|
2289
|
+
# source://puma//lib/puma/launcher.rb#154
|
2290
|
+
def phased_restart; end
|
2291
|
+
|
2292
|
+
# Begin a refork if supported
|
2293
|
+
#
|
2294
|
+
# source://puma//lib/puma/launcher.rb#163
|
2295
|
+
def refork; end
|
2296
|
+
|
2297
|
+
# Begin async restart of the server
|
2298
|
+
#
|
2299
|
+
# source://puma//lib/puma/launcher.rb#148
|
2300
|
+
def restart; end
|
2301
|
+
|
2302
|
+
# source://puma//lib/puma/launcher.rb#199
|
2303
|
+
def restart_args; end
|
2304
|
+
|
2305
|
+
# Returns the value of attribute restart_dir.
|
2306
|
+
#
|
2307
|
+
# source://puma//lib/puma/launcher.rb#102
|
2308
|
+
def restart_dir; end
|
2309
|
+
|
2310
|
+
# Run the server. This blocks until the server is stopped
|
2311
|
+
#
|
2312
|
+
# source://puma//lib/puma/launcher.rb#174
|
2313
|
+
def run; end
|
2314
|
+
|
2315
|
+
# Return stats about the server
|
2316
|
+
#
|
2317
|
+
# source://puma//lib/puma/launcher.rb#105
|
2318
|
+
def stats; end
|
2319
|
+
|
2320
|
+
# Begin async shutdown of the server gracefully
|
2321
|
+
#
|
2322
|
+
# source://puma//lib/puma/launcher.rb#142
|
2323
|
+
def stop; end
|
2324
|
+
|
2325
|
+
# @version 5.0.0
|
2326
|
+
#
|
2327
|
+
# source://puma//lib/puma/launcher.rb#219
|
2328
|
+
def thread_status; end
|
2329
|
+
|
2330
|
+
# Write a state file that can be used by pumactl to control
|
2331
|
+
# the server
|
2332
|
+
#
|
2333
|
+
# source://puma//lib/puma/launcher.rb#111
|
2334
|
+
def write_state; end
|
2335
|
+
|
2336
|
+
private
|
2337
|
+
|
2338
|
+
# @return [Boolean]
|
2339
|
+
#
|
2340
|
+
# source://puma//lib/puma/launcher.rb#339
|
2341
|
+
def clustered?; end
|
2342
|
+
|
2343
|
+
# source://puma//lib/puma/launcher.rb#257
|
2344
|
+
def do_forceful_stop; end
|
2345
|
+
|
2346
|
+
# source://puma//lib/puma/launcher.rb#262
|
2347
|
+
def do_graceful_stop; end
|
2348
|
+
|
2349
|
+
# source://puma//lib/puma/launcher.rb#267
|
2350
|
+
def do_restart(previous_env); end
|
2351
|
+
|
2352
|
+
# source://puma//lib/puma/launcher.rb#244
|
2353
|
+
def do_run_finished(previous_env); end
|
2354
|
+
|
2355
|
+
# source://puma//lib/puma/launcher.rb#365
|
2356
|
+
def environment; end
|
2357
|
+
|
2358
|
+
# source://puma//lib/puma/launcher.rb#378
|
2359
|
+
def generate_restart_data; end
|
2360
|
+
|
2361
|
+
# source://puma//lib/puma/launcher.rb#232
|
2362
|
+
def get_env; end
|
2363
|
+
|
2364
|
+
# Puma's systemd integration allows Puma to inform systemd:
|
2365
|
+
# 1. when it has successfully started
|
2366
|
+
# 2. when it is starting shutdown
|
2367
|
+
# 3. periodically for a liveness check with a watchdog thread
|
2368
|
+
#
|
2369
|
+
# source://puma//lib/puma/launcher.rb#318
|
2370
|
+
def integrate_with_systemd; end
|
2371
|
+
|
2372
|
+
# source://puma//lib/puma/launcher.rb#335
|
2373
|
+
def log(str); end
|
2374
|
+
|
2375
|
+
# source://puma//lib/puma/launcher.rb#488
|
2376
|
+
def log_config; end
|
2377
|
+
|
2378
|
+
# source://puma//lib/puma/launcher.rb#373
|
2379
|
+
def prune_bundler!; end
|
2380
|
+
|
2381
|
+
# @return [Boolean]
|
2382
|
+
#
|
2383
|
+
# source://puma//lib/puma/launcher.rb#369
|
2384
|
+
def prune_bundler?; end
|
2385
|
+
|
2386
|
+
# source://puma//lib/puma/launcher.rb#310
|
2387
|
+
def reload_worker_directory; end
|
2388
|
+
|
2389
|
+
# source://puma//lib/puma/launcher.rb#274
|
2390
|
+
def restart!; end
|
2391
|
+
|
2392
|
+
# source://puma//lib/puma/launcher.rb#348
|
2393
|
+
def set_process_title; end
|
2394
|
+
|
2395
|
+
# source://puma//lib/puma/launcher.rb#359
|
2396
|
+
def set_rack_environment; end
|
2397
|
+
|
2398
|
+
# source://puma//lib/puma/launcher.rb#423
|
2399
|
+
def setup_signals; end
|
2400
|
+
|
2401
|
+
# source://puma//lib/puma/launcher.rb#353
|
2402
|
+
def title; end
|
2403
|
+
|
2404
|
+
# @raise [UnsupportedOption]
|
2405
|
+
#
|
2406
|
+
# source://puma//lib/puma/launcher.rb#343
|
2407
|
+
def unsupported(str); end
|
2408
|
+
|
2409
|
+
# If configured, write the pid of the current process out
|
2410
|
+
# to a file.
|
2411
|
+
#
|
2412
|
+
# source://puma//lib/puma/launcher.rb#300
|
2413
|
+
def write_pid; end
|
2414
|
+
end
|
2415
|
+
|
2416
|
+
# This class is used to pickup Gemfile changes during
|
2417
|
+
# application restarts.
|
2418
|
+
class Puma::Launcher::BundlePruner
|
2419
|
+
# @return [BundlePruner] a new instance of BundlePruner
|
2420
|
+
#
|
2421
|
+
# source://puma//lib/puma/launcher/bundle_pruner.rb#10
|
2422
|
+
def initialize(original_argv, extra_runtime_dependencies, log_writer); end
|
2423
|
+
|
2424
|
+
# source://puma//lib/puma/launcher/bundle_pruner.rb#16
|
2425
|
+
def prune; end
|
2426
|
+
|
2427
|
+
private
|
2428
|
+
|
2429
|
+
# source://puma//lib/puma/launcher/bundle_pruner.rb#75
|
2430
|
+
def extra_runtime_deps_paths; end
|
2431
|
+
|
2432
|
+
# source://puma//lib/puma/launcher/bundle_pruner.rb#99
|
2433
|
+
def log(str); end
|
2434
|
+
|
2435
|
+
# source://puma//lib/puma/launcher/bundle_pruner.rb#71
|
2436
|
+
def paths_to_require_after_prune; end
|
2437
|
+
|
2438
|
+
# source://puma//lib/puma/launcher/bundle_pruner.rb#87
|
2439
|
+
def puma_require_paths; end
|
2440
|
+
|
2441
|
+
# source://puma//lib/puma/launcher/bundle_pruner.rb#57
|
2442
|
+
def puma_wild_path; end
|
2443
|
+
|
2444
|
+
# source://puma//lib/puma/launcher/bundle_pruner.rb#95
|
2445
|
+
def require_paths_for_gem(gem_spec); end
|
2446
|
+
|
2447
|
+
# source://puma//lib/puma/launcher/bundle_pruner.rb#48
|
2448
|
+
def require_rubygems_min_version!; end
|
2449
|
+
|
2450
|
+
# source://puma//lib/puma/launcher/bundle_pruner.rb#91
|
2451
|
+
def spec_for_gem(gem_name); end
|
2452
|
+
|
2453
|
+
# source://puma//lib/puma/launcher/bundle_pruner.rb#62
|
2454
|
+
def with_unbundled_env; end
|
2455
|
+
end
|
2456
|
+
|
2457
|
+
# Handles logging concerns for both standard messages
|
2458
|
+
# (+stdout+) and errors (+stderr+).
|
2459
|
+
class Puma::LogWriter
|
2460
|
+
# Create a LogWriter that prints to +stdout+ and +stderr+.
|
2461
|
+
#
|
2462
|
+
# @return [LogWriter] a new instance of LogWriter
|
2463
|
+
#
|
2464
|
+
# source://puma//lib/puma/log_writer.rb#34
|
2465
|
+
def initialize(stdout, stderr); end
|
2466
|
+
|
2467
|
+
# An HTTP connection error has occurred.
|
2468
|
+
# +error+ a connection exception, +req+ the request,
|
2469
|
+
# and +text+ additional info
|
2470
|
+
#
|
2471
|
+
# @version 5.0.0
|
2472
|
+
#
|
2473
|
+
# source://puma//lib/puma/log_writer.rb#101
|
2474
|
+
def connection_error(error, req, text = T.unsafe(nil)); end
|
2475
|
+
|
2476
|
+
# source://puma//lib/puma/log_writer.rb#83
|
2477
|
+
def debug(str); end
|
2478
|
+
|
2479
|
+
# Log occurred error debug dump.
|
2480
|
+
# +error+ an exception object, +req+ the request,
|
2481
|
+
# and +text+ additional info
|
2482
|
+
#
|
2483
|
+
# @version 5.0.0
|
2484
|
+
#
|
2485
|
+
# source://puma//lib/puma/log_writer.rb#133
|
2486
|
+
def debug_error(error, req = T.unsafe(nil), text = T.unsafe(nil)); end
|
2487
|
+
|
2488
|
+
# Write +str+ to +@stderr+
|
2489
|
+
#
|
2490
|
+
# source://puma//lib/puma/log_writer.rb#88
|
2491
|
+
def error(str); end
|
2492
|
+
|
2493
|
+
# source://puma//lib/puma/log_writer.rb#93
|
2494
|
+
def format(str); end
|
2495
|
+
|
2496
|
+
# Returns the value of attribute formatter.
|
2497
|
+
#
|
2498
|
+
# source://puma//lib/puma/log_writer.rb#31
|
2499
|
+
def formatter; end
|
2500
|
+
|
2501
|
+
# Sets the attribute formatter
|
2502
|
+
#
|
2503
|
+
# @param value the value to set the attribute formatter to.
|
2504
|
+
#
|
2505
|
+
# source://puma//lib/puma/log_writer.rb#31
|
2506
|
+
def formatter=(_arg0); end
|
2507
|
+
|
2508
|
+
# Write +str+ to +@stdout+
|
2509
|
+
#
|
2510
|
+
# source://puma//lib/puma/log_writer.rb#61
|
2511
|
+
def log(str); end
|
2512
|
+
|
2513
|
+
# An HTTP parse error has occurred.
|
2514
|
+
# +error+ a parsing exception,
|
2515
|
+
# and +req+ the request.
|
2516
|
+
#
|
2517
|
+
# source://puma//lib/puma/log_writer.rb#108
|
2518
|
+
def parse_error(error, req); end
|
2519
|
+
|
2520
|
+
# An SSL error has occurred.
|
2521
|
+
#
|
2522
|
+
# @param error [Puma::MiniSSL::SSLError]
|
2523
|
+
# @param ssl_socket [Puma::MiniSSL::Socket]
|
2524
|
+
#
|
2525
|
+
# source://puma//lib/puma/log_writer.rb#115
|
2526
|
+
def ssl_error(error, ssl_socket); end
|
2527
|
+
|
2528
|
+
# Returns the value of attribute stderr.
|
2529
|
+
#
|
2530
|
+
# source://puma//lib/puma/log_writer.rb#28
|
2531
|
+
def stderr; end
|
2532
|
+
|
2533
|
+
# Returns the value of attribute stdout.
|
2534
|
+
#
|
2535
|
+
# source://puma//lib/puma/log_writer.rb#28
|
2536
|
+
def stdout; end
|
2537
|
+
|
2538
|
+
# An unknown error has occurred.
|
2539
|
+
# +error+ an exception object, +req+ the request,
|
2540
|
+
# and +text+ additional info
|
2541
|
+
#
|
2542
|
+
# source://puma//lib/puma/log_writer.rb#125
|
2543
|
+
def unknown_error(error, req = T.unsafe(nil), text = T.unsafe(nil)); end
|
2544
|
+
|
2545
|
+
# source://puma//lib/puma/log_writer.rb#65
|
2546
|
+
def write(str); end
|
2547
|
+
|
2548
|
+
private
|
2549
|
+
|
2550
|
+
# source://puma//lib/puma/log_writer.rb#69
|
2551
|
+
def internal_write(str); end
|
2552
|
+
|
2553
|
+
class << self
|
2554
|
+
# source://puma//lib/puma/log_writer.rb#55
|
2555
|
+
def null; end
|
2556
|
+
|
2557
|
+
# source://puma//lib/puma/log_writer.rb#51
|
2558
|
+
def stdio; end
|
2559
|
+
|
2560
|
+
# Returns an LogWriter object which writes its status to
|
2561
|
+
# two StringIO objects.
|
2562
|
+
#
|
2563
|
+
# source://puma//lib/puma/log_writer.rb#47
|
2564
|
+
def strings; end
|
2565
|
+
end
|
2566
|
+
end
|
2567
|
+
|
2568
|
+
# source://puma//lib/puma/log_writer.rb#43
|
2569
|
+
Puma::LogWriter::DEFAULT = T.let(T.unsafe(nil), Puma::LogWriter)
|
2570
|
+
|
2571
|
+
class Puma::LogWriter::DefaultFormatter
|
2572
|
+
# source://puma//lib/puma/log_writer.rb#15
|
2573
|
+
def call(str); end
|
2574
|
+
end
|
2575
|
+
|
2576
|
+
# source://puma//lib/puma/log_writer.rb#26
|
2577
|
+
Puma::LogWriter::LOG_QUEUE = T.let(T.unsafe(nil), Thread::Queue)
|
2578
|
+
|
2579
|
+
class Puma::LogWriter::PidFormatter
|
2580
|
+
# source://puma//lib/puma/log_writer.rb#21
|
2581
|
+
def call(str); end
|
2582
|
+
end
|
2583
|
+
|
2584
|
+
module Puma::MiniSSL
|
2585
|
+
class << self
|
2586
|
+
def check; end
|
2587
|
+
end
|
2588
|
+
end
|
2589
|
+
|
2590
|
+
class Puma::MiniSSL::Context
|
2591
|
+
# @return [Context] a new instance of Context
|
2592
|
+
#
|
2593
|
+
# source://puma//lib/puma/minissl.rb#206
|
2594
|
+
def initialize; end
|
2595
|
+
|
2596
|
+
# Returns the value of attribute ca.
|
2597
|
+
#
|
2598
|
+
# source://puma//lib/puma/minissl.rb#281
|
2599
|
+
def ca; end
|
2600
|
+
|
2601
|
+
# source://puma//lib/puma/minissl.rb#299
|
2602
|
+
def ca=(ca); end
|
2603
|
+
|
2604
|
+
# Returns the value of attribute cert.
|
2605
|
+
#
|
2606
|
+
# source://puma//lib/puma/minissl.rb#280
|
2607
|
+
def cert; end
|
2608
|
+
|
2609
|
+
# source://puma//lib/puma/minissl.rb#294
|
2610
|
+
def cert=(cert); end
|
2611
|
+
|
2612
|
+
# Returns the value of attribute cert_pem.
|
2613
|
+
#
|
2614
|
+
# source://puma//lib/puma/minissl.rb#282
|
2615
|
+
def cert_pem; end
|
2616
|
+
|
2617
|
+
# @raise [ArgumentError]
|
2618
|
+
#
|
2619
|
+
# source://puma//lib/puma/minissl.rb#304
|
2620
|
+
def cert_pem=(cert_pem); end
|
2621
|
+
|
2622
|
+
# source://puma//lib/puma/minissl.rb#314
|
2623
|
+
def check; end
|
2624
|
+
|
2625
|
+
# @raise [ArgumentError]
|
2626
|
+
#
|
2627
|
+
# source://puma//lib/puma/minissl.rb#218
|
2628
|
+
def check_file(file, desc); end
|
2629
|
+
|
2630
|
+
# non-jruby Context properties
|
2631
|
+
#
|
2632
|
+
# source://puma//lib/puma/minissl.rb#279
|
2633
|
+
def key; end
|
2634
|
+
|
2635
|
+
# source://puma//lib/puma/minissl.rb#289
|
2636
|
+
def key=(key); end
|
2637
|
+
|
2638
|
+
# Returns the value of attribute key_pem.
|
2639
|
+
#
|
2640
|
+
# source://puma//lib/puma/minissl.rb#283
|
2641
|
+
def key_pem; end
|
2642
|
+
|
2643
|
+
# @raise [ArgumentError]
|
2644
|
+
#
|
2645
|
+
# source://puma//lib/puma/minissl.rb#309
|
2646
|
+
def key_pem=(key_pem); end
|
2647
|
+
|
2648
|
+
# Returns the value of attribute no_tlsv1.
|
2649
|
+
#
|
2650
|
+
# source://puma//lib/puma/minissl.rb#204
|
2651
|
+
def no_tlsv1; end
|
2652
|
+
|
2653
|
+
# disables TLSv1
|
2654
|
+
#
|
2655
|
+
# @raise [ArgumentError]
|
2656
|
+
#
|
2657
|
+
# source://puma//lib/puma/minissl.rb#351
|
2658
|
+
def no_tlsv1=(tlsv1); end
|
2659
|
+
|
2660
|
+
# Returns the value of attribute no_tlsv1_1.
|
2661
|
+
#
|
2662
|
+
# source://puma//lib/puma/minissl.rb#204
|
2663
|
+
def no_tlsv1_1; end
|
2664
|
+
|
2665
|
+
# disables TLSv1 and TLSv1.1. Overrides `#no_tlsv1=`
|
2666
|
+
#
|
2667
|
+
# @raise [ArgumentError]
|
2668
|
+
#
|
2669
|
+
# source://puma//lib/puma/minissl.rb#358
|
2670
|
+
def no_tlsv1_1=(tlsv1_1); end
|
2671
|
+
|
2672
|
+
# Returns the value of attribute reuse.
|
2673
|
+
#
|
2674
|
+
# source://puma//lib/puma/minissl.rb#287
|
2675
|
+
def reuse; end
|
2676
|
+
|
2677
|
+
# Controls session reuse. Allowed values are as follows:
|
2678
|
+
# * 'off' - matches the behavior of Puma 5.6 and earlier. This is included
|
2679
|
+
# in case reuse 'on' is made the default in future Puma versions.
|
2680
|
+
# * 'dflt' - sets session reuse on, with OpenSSL default cache size of
|
2681
|
+
# 20k and default timeout of 300 seconds.
|
2682
|
+
# * 's,t' - where s and t are integer strings, for size and timeout.
|
2683
|
+
# * 's' - where s is an integer strings for size.
|
2684
|
+
# * ',t' - where t is an integer strings for timeout.
|
2685
|
+
#
|
2686
|
+
# source://puma//lib/puma/minissl.rb#328
|
2687
|
+
def reuse=(reuse_str); end
|
2688
|
+
|
2689
|
+
# Returns the value of attribute reuse_cache_size.
|
2690
|
+
#
|
2691
|
+
# source://puma//lib/puma/minissl.rb#287
|
2692
|
+
def reuse_cache_size; end
|
2693
|
+
|
2694
|
+
# Returns the value of attribute reuse_timeout.
|
2695
|
+
#
|
2696
|
+
# source://puma//lib/puma/minissl.rb#287
|
2697
|
+
def reuse_timeout; end
|
2698
|
+
|
2699
|
+
# Returns the value of attribute ssl_cipher_filter.
|
2700
|
+
#
|
2701
|
+
# source://puma//lib/puma/minissl.rb#284
|
2702
|
+
def ssl_cipher_filter; end
|
2703
|
+
|
2704
|
+
# Sets the attribute ssl_cipher_filter
|
2705
|
+
#
|
2706
|
+
# @param value the value to set the attribute ssl_cipher_filter to.
|
2707
|
+
#
|
2708
|
+
# source://puma//lib/puma/minissl.rb#284
|
2709
|
+
def ssl_cipher_filter=(_arg0); end
|
2710
|
+
|
2711
|
+
# Returns the value of attribute verification_flags.
|
2712
|
+
#
|
2713
|
+
# source://puma//lib/puma/minissl.rb#285
|
2714
|
+
def verification_flags; end
|
2715
|
+
|
2716
|
+
# Sets the attribute verification_flags
|
2717
|
+
#
|
2718
|
+
# @param value the value to set the attribute verification_flags to.
|
2719
|
+
#
|
2720
|
+
# source://puma//lib/puma/minissl.rb#285
|
2721
|
+
def verification_flags=(_arg0); end
|
2722
|
+
|
2723
|
+
# Returns the value of attribute verify_mode.
|
2724
|
+
#
|
2725
|
+
# source://puma//lib/puma/minissl.rb#203
|
2726
|
+
def verify_mode; end
|
2727
|
+
|
2728
|
+
# Sets the attribute verify_mode
|
2729
|
+
#
|
2730
|
+
# @param value the value to set the attribute verify_mode to.
|
2731
|
+
#
|
2732
|
+
# source://puma//lib/puma/minissl.rb#203
|
2733
|
+
def verify_mode=(_arg0); end
|
2734
|
+
end
|
2735
|
+
|
2736
|
+
class Puma::MiniSSL::ContextBuilder
|
2737
|
+
# @return [ContextBuilder] a new instance of ContextBuilder
|
2738
|
+
#
|
2739
|
+
# source://puma//lib/puma/minissl/context_builder.rb#4
|
2740
|
+
def initialize(params, log_writer); end
|
2741
|
+
|
2742
|
+
# source://puma//lib/puma/minissl/context_builder.rb#9
|
2743
|
+
def context; end
|
2744
|
+
|
2745
|
+
private
|
2746
|
+
|
2747
|
+
# Returns the value of attribute log_writer.
|
2748
|
+
#
|
2749
|
+
# source://puma//lib/puma/minissl/context_builder.rb#89
|
2750
|
+
def log_writer; end
|
2751
|
+
|
2752
|
+
# Returns the value of attribute params.
|
2753
|
+
#
|
2754
|
+
# source://puma//lib/puma/minissl/context_builder.rb#89
|
2755
|
+
def params; end
|
2756
|
+
end
|
2757
|
+
|
2758
|
+
class Puma::MiniSSL::Engine
|
2759
|
+
def extract; end
|
2760
|
+
def init?; end
|
2761
|
+
def inject(_arg0); end
|
2762
|
+
def peercert; end
|
2763
|
+
def read; end
|
2764
|
+
def shutdown; end
|
2765
|
+
def ssl_vers_st; end
|
2766
|
+
def write(_arg0); end
|
2767
|
+
|
2768
|
+
class << self
|
2769
|
+
def client; end
|
2770
|
+
def server(_arg0); end
|
2771
|
+
end
|
2772
|
+
end
|
2773
|
+
|
2774
|
+
# Define constant at runtime, as it's easy to determine at built time,
|
2775
|
+
# but Puma could (it shouldn't) be loaded with an older OpenSSL version
|
2776
|
+
#
|
2777
|
+
# @version 5.0.0
|
2778
|
+
#
|
2779
|
+
# source://puma//lib/puma/minissl.rb#17
|
2780
|
+
Puma::MiniSSL::HAS_TLS1_3 = T.let(T.unsafe(nil), TrueClass)
|
2781
|
+
|
2782
|
+
Puma::MiniSSL::OPENSSL_LIBRARY_VERSION = T.let(T.unsafe(nil), String)
|
2783
|
+
Puma::MiniSSL::OPENSSL_NO_SSL3 = T.let(T.unsafe(nil), TrueClass)
|
2784
|
+
Puma::MiniSSL::OPENSSL_NO_TLS1 = T.let(T.unsafe(nil), FalseClass)
|
2785
|
+
Puma::MiniSSL::OPENSSL_NO_TLS1_1 = T.let(T.unsafe(nil), FalseClass)
|
2786
|
+
Puma::MiniSSL::OPENSSL_VERSION = T.let(T.unsafe(nil), String)
|
2787
|
+
|
2788
|
+
class Puma::MiniSSL::SSLContext
|
2789
|
+
def initialize(_arg0); end
|
2790
|
+
end
|
2791
|
+
|
2792
|
+
# this class is defined so that it exists when Puma is compiled
|
2793
|
+
# without ssl support, as Server and Reactor use it in rescue statements.
|
2794
|
+
class Puma::MiniSSL::SSLError < ::StandardError; end
|
2795
|
+
|
2796
|
+
class Puma::MiniSSL::Server
|
2797
|
+
# @return [Server] a new instance of Server
|
2798
|
+
#
|
2799
|
+
# source://puma//lib/puma/minissl.rb#396
|
2800
|
+
def initialize(socket, ctx); end
|
2801
|
+
|
2802
|
+
# source://puma//lib/puma/minissl.rb#402
|
2803
|
+
def accept; end
|
2804
|
+
|
2805
|
+
# source://puma//lib/puma/minissl.rb#409
|
2806
|
+
def accept_nonblock; end
|
2807
|
+
|
2808
|
+
# @version 5.0.0
|
2809
|
+
#
|
2810
|
+
# source://puma//lib/puma/minissl.rb#423
|
2811
|
+
def addr; end
|
2812
|
+
|
2813
|
+
# source://puma//lib/puma/minissl.rb#427
|
2814
|
+
def close; end
|
2815
|
+
|
2816
|
+
# @return [Boolean]
|
2817
|
+
#
|
2818
|
+
# source://puma//lib/puma/minissl.rb#431
|
2819
|
+
def closed?; end
|
2820
|
+
|
2821
|
+
# source://puma//lib/puma/minissl.rb#417
|
2822
|
+
def to_io; end
|
2823
|
+
end
|
2824
|
+
|
2825
|
+
class Puma::MiniSSL::Socket
|
2826
|
+
# @return [Socket] a new instance of Socket
|
2827
|
+
#
|
2828
|
+
# source://puma//lib/puma/minissl.rb#22
|
2829
|
+
def initialize(socket, engine); end
|
2830
|
+
|
2831
|
+
# source://puma//lib/puma/minissl.rb#119
|
2832
|
+
def <<(data); end
|
2833
|
+
|
2834
|
+
# source://puma//lib/puma/minissl.rb#166
|
2835
|
+
def close; end
|
2836
|
+
|
2837
|
+
# @return [Boolean]
|
2838
|
+
#
|
2839
|
+
# source://puma//lib/puma/minissl.rb#34
|
2840
|
+
def closed?; end
|
2841
|
+
|
2842
|
+
# source://puma//lib/puma/minissl.rb#76
|
2843
|
+
def engine_read_all; end
|
2844
|
+
|
2845
|
+
# source://puma//lib/puma/minissl.rb#162
|
2846
|
+
def flush; end
|
2847
|
+
|
2848
|
+
# source://puma//lib/puma/minissl.rb#182
|
2849
|
+
def peeraddr; end
|
2850
|
+
|
2851
|
+
# source://puma//lib/puma/minissl.rb#187
|
2852
|
+
def peercert; end
|
2853
|
+
|
2854
|
+
# source://puma//lib/puma/minissl.rb#84
|
2855
|
+
def read_nonblock(size, *_); end
|
2856
|
+
|
2857
|
+
# source://puma//lib/puma/minissl.rb#59
|
2858
|
+
def readpartial(size); end
|
2859
|
+
|
2860
|
+
# Returns a two element array,
|
2861
|
+
# first is protocol version (SSL_get_version),
|
2862
|
+
# second is 'handshake' state (SSL_state_string)
|
2863
|
+
#
|
2864
|
+
# Used for dropping tcp connections to ssl.
|
2865
|
+
# See OpenSSL ssl/ssl_stat.c SSL_state_string for info
|
2866
|
+
#
|
2867
|
+
# @version 5.0.0
|
2868
|
+
#
|
2869
|
+
# source://puma//lib/puma/minissl.rb#47
|
2870
|
+
def ssl_version_state; end
|
2871
|
+
|
2872
|
+
# source://puma//lib/puma/minissl.rb#119
|
2873
|
+
def syswrite(data); end
|
2874
|
+
|
2875
|
+
# source://puma//lib/puma/minissl.rb#30
|
2876
|
+
def to_io; end
|
2877
|
+
|
2878
|
+
# source://puma//lib/puma/minissl.rb#119
|
2879
|
+
def write(data); end
|
2880
|
+
|
2881
|
+
# The problem with implementing it properly
|
2882
|
+
# is that it means we'd have to have the ability to rewind
|
2883
|
+
# an engine because after we write+extract, the socket
|
2884
|
+
# write_nonblock call might raise an exception and later
|
2885
|
+
# code would pass the same data in, but the engine would think
|
2886
|
+
# it had already written the data in.
|
2887
|
+
#
|
2888
|
+
# So for the time being (and since write blocking is quite rare),
|
2889
|
+
# go ahead and actually block in write_nonblock.
|
2890
|
+
#
|
2891
|
+
# source://puma//lib/puma/minissl.rb#158
|
2892
|
+
def write_nonblock(data, *_); end
|
2893
|
+
|
2894
|
+
private
|
2895
|
+
|
2896
|
+
# Used to check the handshake status, in particular when a TCP connection
|
2897
|
+
# is made with TLSv1.3 as an available protocol
|
2898
|
+
#
|
2899
|
+
# @return [Boolean]
|
2900
|
+
# @version 5.0.0
|
2901
|
+
#
|
2902
|
+
# source://puma//lib/puma/minissl.rb#54
|
2903
|
+
def bad_tlsv1_3?; end
|
2904
|
+
end
|
2905
|
+
|
2906
|
+
# https://github.com/openssl/openssl/blob/master/include/openssl/x509_vfy.h.in
|
2907
|
+
# /* Certificate verify flags */
|
2908
|
+
#
|
2909
|
+
# source://puma//lib/puma/minissl.rb#371
|
2910
|
+
Puma::MiniSSL::VERIFICATION_FLAGS = T.let(T.unsafe(nil), Hash)
|
2911
|
+
|
2912
|
+
# source://puma//lib/puma/minissl.rb#367
|
2913
|
+
Puma::MiniSSL::VERIFY_FAIL_IF_NO_PEER_CERT = T.let(T.unsafe(nil), Integer)
|
2914
|
+
|
2915
|
+
# source://puma//lib/puma/minissl.rb#365
|
2916
|
+
Puma::MiniSSL::VERIFY_NONE = T.let(T.unsafe(nil), Integer)
|
2917
|
+
|
2918
|
+
# source://puma//lib/puma/minissl.rb#366
|
2919
|
+
Puma::MiniSSL::VERIFY_PEER = T.let(T.unsafe(nil), Integer)
|
2920
|
+
|
2921
|
+
# Provides an IO-like object that always appears to contain no data.
|
2922
|
+
# Used as the value for rack.input when the request has no body.
|
2923
|
+
class Puma::NullIO
|
2924
|
+
# source://puma//lib/puma/null_io.rb#28
|
2925
|
+
def close; end
|
2926
|
+
|
2927
|
+
# This is used as singleton class, so can't have state.
|
2928
|
+
#
|
2929
|
+
# @return [Boolean]
|
2930
|
+
#
|
2931
|
+
# source://puma//lib/puma/null_io.rb#57
|
2932
|
+
def closed?; end
|
2933
|
+
|
2934
|
+
# source://puma//lib/puma/null_io.rb#16
|
2935
|
+
def each; end
|
2936
|
+
|
2937
|
+
# @return [Boolean]
|
2938
|
+
#
|
2939
|
+
# source://puma//lib/puma/null_io.rb#35
|
2940
|
+
def eof?; end
|
2941
|
+
|
2942
|
+
# source://puma//lib/puma/null_io.rb#52
|
2943
|
+
def flush; end
|
2944
|
+
|
2945
|
+
# source://puma//lib/puma/null_io.rb#8
|
2946
|
+
def gets; end
|
2947
|
+
|
2948
|
+
# source://puma//lib/puma/null_io.rb#46
|
2949
|
+
def puts(*ary); end
|
2950
|
+
|
2951
|
+
# Mimics IO#read with no data.
|
2952
|
+
#
|
2953
|
+
# source://puma//lib/puma/null_io.rb#21
|
2954
|
+
def read(count = T.unsafe(nil), _buffer = T.unsafe(nil)); end
|
2955
|
+
|
2956
|
+
# source://puma//lib/puma/null_io.rb#25
|
2957
|
+
def rewind; end
|
2958
|
+
|
2959
|
+
# source://puma//lib/puma/null_io.rb#31
|
2960
|
+
def size; end
|
2961
|
+
|
2962
|
+
# source://puma//lib/puma/null_io.rb#12
|
2963
|
+
def string; end
|
2964
|
+
|
2965
|
+
# source://puma//lib/puma/null_io.rb#39
|
2966
|
+
def sync; end
|
2967
|
+
|
2968
|
+
# source://puma//lib/puma/null_io.rb#43
|
2969
|
+
def sync=(v); end
|
2970
|
+
|
2971
|
+
# source://puma//lib/puma/null_io.rb#49
|
2972
|
+
def write(*ary); end
|
2973
|
+
end
|
2974
|
+
|
2975
|
+
class Puma::Plugin
|
2976
|
+
# source://puma//lib/puma/plugin.rb#107
|
2977
|
+
def in_background(&blk); end
|
2978
|
+
|
2979
|
+
class << self
|
2980
|
+
# source://puma//lib/puma/plugin.rb#97
|
2981
|
+
def create(&blk); end
|
2982
|
+
|
2983
|
+
# source://puma//lib/puma/plugin.rb#90
|
2984
|
+
def extract_name(ary); end
|
2985
|
+
end
|
2986
|
+
end
|
2987
|
+
|
2988
|
+
# Matches
|
2989
|
+
# "C:/Ruby22/lib/ruby/gems/2.2.0/gems/puma-3.0.1/lib/puma/plugin/tmp_restart.rb:3:in `<top (required)>'"
|
2990
|
+
# AS
|
2991
|
+
# C:/Ruby22/lib/ruby/gems/2.2.0/gems/puma-3.0.1/lib/puma/plugin/tmp_restart.rb
|
2992
|
+
#
|
2993
|
+
# source://puma//lib/puma/plugin.rb#81
|
2994
|
+
Puma::Plugin::CALLER_FILE = T.let(T.unsafe(nil), Regexp)
|
2995
|
+
|
2996
|
+
class Puma::PluginLoader
|
2997
|
+
# @return [PluginLoader] a new instance of PluginLoader
|
2998
|
+
#
|
2999
|
+
# source://puma//lib/puma/plugin.rb#7
|
3000
|
+
def initialize; end
|
3001
|
+
|
3002
|
+
# @raise [UnknownPlugin]
|
3003
|
+
#
|
3004
|
+
# source://puma//lib/puma/plugin.rb#11
|
3005
|
+
def create(name); end
|
3006
|
+
|
3007
|
+
# source://puma//lib/puma/plugin.rb#21
|
3008
|
+
def fire_starts(launcher); end
|
3009
|
+
end
|
3010
|
+
|
3011
|
+
class Puma::PluginRegistry
|
3012
|
+
# @return [PluginRegistry] a new instance of PluginRegistry
|
3013
|
+
#
|
3014
|
+
# source://puma//lib/puma/plugin.rb#31
|
3015
|
+
def initialize; end
|
3016
|
+
|
3017
|
+
# source://puma//lib/puma/plugin.rb#60
|
3018
|
+
def add_background(blk); end
|
3019
|
+
|
3020
|
+
# @raise [UnknownPlugin]
|
3021
|
+
#
|
3022
|
+
# source://puma//lib/puma/plugin.rb#40
|
3023
|
+
def find(name); end
|
3024
|
+
|
3025
|
+
# source://puma//lib/puma/plugin.rb#64
|
3026
|
+
def fire_background; end
|
3027
|
+
|
3028
|
+
# source://puma//lib/puma/plugin.rb#36
|
3029
|
+
def register(name, cls); end
|
3030
|
+
end
|
3031
|
+
|
3032
|
+
# source://puma//lib/puma/plugin.rb#74
|
3033
|
+
Puma::Plugins = T.let(T.unsafe(nil), Puma::PluginRegistry)
|
3034
|
+
|
3035
|
+
module Puma::Rack; end
|
3036
|
+
|
3037
|
+
# Rack::Builder implements a small DSL to iteratively construct Rack
|
3038
|
+
# applications.
|
3039
|
+
#
|
3040
|
+
# Example:
|
3041
|
+
#
|
3042
|
+
# require 'rack/lobster'
|
3043
|
+
# app = Rack::Builder.new do
|
3044
|
+
# use Rack::CommonLogger
|
3045
|
+
# use Rack::ShowExceptions
|
3046
|
+
# map "/lobster" do
|
3047
|
+
# use Rack::Lint
|
3048
|
+
# run Rack::Lobster.new
|
3049
|
+
# end
|
3050
|
+
# end
|
3051
|
+
#
|
3052
|
+
# run app
|
3053
|
+
#
|
3054
|
+
# Or
|
3055
|
+
#
|
3056
|
+
# app = Rack::Builder.app do
|
3057
|
+
# use Rack::CommonLogger
|
3058
|
+
# run lambda { |env| [200, {'Content-Type' => 'text/plain'}, ['OK']] }
|
3059
|
+
# end
|
3060
|
+
#
|
3061
|
+
# run app
|
3062
|
+
#
|
3063
|
+
# +use+ adds middleware to the stack, +run+ dispatches to an application.
|
3064
|
+
# You can use +map+ to construct a Rack::URLMap in a convenient way.
|
3065
|
+
class Puma::Rack::Builder
|
3066
|
+
# @return [Builder] a new instance of Builder
|
3067
|
+
#
|
3068
|
+
# source://puma//lib/puma/rack/builder.rb#176
|
3069
|
+
def initialize(default_app = T.unsafe(nil), &block); end
|
3070
|
+
|
3071
|
+
# source://puma//lib/puma/rack/builder.rb#283
|
3072
|
+
def call(env); end
|
3073
|
+
|
3074
|
+
# Creates a route within the application.
|
3075
|
+
#
|
3076
|
+
# Rack::Builder.app do
|
3077
|
+
# map '/' do
|
3078
|
+
# run Heartbeat
|
3079
|
+
# end
|
3080
|
+
# end
|
3081
|
+
#
|
3082
|
+
# The +use+ method can also be used here to specify middleware to run under a specific path:
|
3083
|
+
#
|
3084
|
+
# Rack::Builder.app do
|
3085
|
+
# map '/' do
|
3086
|
+
# use Middleware
|
3087
|
+
# run Heartbeat
|
3088
|
+
# end
|
3089
|
+
# end
|
3090
|
+
#
|
3091
|
+
# This example includes a piece of middleware which will run before requests hit +Heartbeat+.
|
3092
|
+
#
|
3093
|
+
# source://puma//lib/puma/rack/builder.rb#270
|
3094
|
+
def map(path, &block); end
|
3095
|
+
|
3096
|
+
# Takes an argument that is an object that responds to #call and returns a Rack response.
|
3097
|
+
# The simplest form of this is a lambda object:
|
3098
|
+
#
|
3099
|
+
# run lambda { |env| [200, { "Content-Type" => "text/plain" }, ["OK"]] }
|
3100
|
+
#
|
3101
|
+
# However this could also be a class:
|
3102
|
+
#
|
3103
|
+
# class Heartbeat
|
3104
|
+
# def self.call(env)
|
3105
|
+
# [200, { "Content-Type" => "text/plain" }, ["OK"]]
|
3106
|
+
# end
|
3107
|
+
# end
|
3108
|
+
#
|
3109
|
+
# run Heartbeat
|
3110
|
+
#
|
3111
|
+
# source://puma//lib/puma/rack/builder.rb#234
|
3112
|
+
def run(app); end
|
3113
|
+
|
3114
|
+
# source://puma//lib/puma/rack/builder.rb#275
|
3115
|
+
def to_app; end
|
3116
|
+
|
3117
|
+
# Specifies middleware to use in a stack.
|
3118
|
+
#
|
3119
|
+
# class Middleware
|
3120
|
+
# def initialize(app)
|
3121
|
+
# @app = app
|
3122
|
+
# end
|
3123
|
+
#
|
3124
|
+
# def call(env)
|
3125
|
+
# env["rack.some_header"] = "setting an example"
|
3126
|
+
# @app.call(env)
|
3127
|
+
# end
|
3128
|
+
# end
|
3129
|
+
#
|
3130
|
+
# use Middleware
|
3131
|
+
# run lambda { |env| [200, { "Content-Type" => "text/plain" }, ["OK"]] }
|
3132
|
+
#
|
3133
|
+
# All requests through to this application will first be processed by the middleware class.
|
3134
|
+
# The +call+ method in this example sets an additional environment key which then can be
|
3135
|
+
# referenced in the application if required.
|
3136
|
+
#
|
3137
|
+
# source://puma//lib/puma/rack/builder.rb#212
|
3138
|
+
def use(middleware, *args, &block); end
|
3139
|
+
|
3140
|
+
# Takes a lambda or block that is used to warm-up the application.
|
3141
|
+
#
|
3142
|
+
# warmup do |app|
|
3143
|
+
# client = Rack::MockRequest.new(app)
|
3144
|
+
# client.get('/')
|
3145
|
+
# end
|
3146
|
+
#
|
3147
|
+
# use SomeMiddleware
|
3148
|
+
# run MyApp
|
3149
|
+
#
|
3150
|
+
# source://puma//lib/puma/rack/builder.rb#247
|
3151
|
+
def warmup(prc = T.unsafe(nil), &block); end
|
3152
|
+
|
3153
|
+
private
|
3154
|
+
|
3155
|
+
# source://puma//lib/puma/rack/builder.rb#289
|
3156
|
+
def generate_map(default_app, mapping); end
|
3157
|
+
|
3158
|
+
class << self
|
3159
|
+
# source://puma//lib/puma/rack/builder.rb#189
|
3160
|
+
def app(default_app = T.unsafe(nil), &block); end
|
3161
|
+
|
3162
|
+
# source://puma//lib/puma/rack/builder.rb#171
|
3163
|
+
def new_from_string(builder_script, file = T.unsafe(nil)); end
|
3164
|
+
|
3165
|
+
# source://puma//lib/puma/rack/builder.rb#155
|
3166
|
+
def parse_file(config, opts = T.unsafe(nil)); end
|
3167
|
+
end
|
3168
|
+
end
|
3169
|
+
|
3170
|
+
class Puma::Rack::Options
|
3171
|
+
# source://puma//lib/puma/rack/builder.rb#101
|
3172
|
+
def handler_opts(options); end
|
3173
|
+
|
3174
|
+
# source://puma//lib/puma/rack/builder.rb#8
|
3175
|
+
def parse!(args); end
|
3176
|
+
end
|
3177
|
+
|
3178
|
+
# Monitors a collection of IO objects, calling a block whenever
|
3179
|
+
# any monitored object either receives data or times out, or when the Reactor shuts down.
|
3180
|
+
#
|
3181
|
+
# The waiting/wake up is performed with nio4r, which will use the appropriate backend (libev,
|
3182
|
+
# Java NIO or just plain IO#select). The call to `NIO::Selector#select` will
|
3183
|
+
# 'wakeup' any IO object that receives data.
|
3184
|
+
#
|
3185
|
+
# This class additionally tracks a timeout for every added object,
|
3186
|
+
# and wakes up any object when its timeout elapses.
|
3187
|
+
#
|
3188
|
+
# The implementation uses a Queue to synchronize adding new objects from the internal select loop.
|
3189
|
+
class Puma::Reactor
|
3190
|
+
# Create a new Reactor to monitor IO objects added by #add.
|
3191
|
+
# The provided block will be invoked when an IO has data available to read,
|
3192
|
+
# its timeout elapses, or when the Reactor shuts down.
|
3193
|
+
#
|
3194
|
+
# @return [Reactor] a new instance of Reactor
|
3195
|
+
#
|
3196
|
+
# source://puma//lib/puma/reactor.rb#23
|
3197
|
+
def initialize(backend, &block); end
|
3198
|
+
|
3199
|
+
# Add a new client to monitor.
|
3200
|
+
# The object must respond to #timeout and #timeout_at.
|
3201
|
+
# Returns false if the reactor is already shut down.
|
3202
|
+
#
|
3203
|
+
# source://puma//lib/puma/reactor.rb#49
|
3204
|
+
def add(client); end
|
3205
|
+
|
3206
|
+
# Run the internal select loop, using a background thread by default.
|
3207
|
+
#
|
3208
|
+
# source://puma//lib/puma/reactor.rb#35
|
3209
|
+
def run(background = T.unsafe(nil)); end
|
3210
|
+
|
3211
|
+
# Shutdown the reactor, blocking until the background thread is finished.
|
3212
|
+
#
|
3213
|
+
# source://puma//lib/puma/reactor.rb#58
|
3214
|
+
def shutdown; end
|
3215
|
+
|
3216
|
+
private
|
3217
|
+
|
3218
|
+
# Start monitoring the object.
|
3219
|
+
#
|
3220
|
+
# source://puma//lib/puma/reactor.rb#100
|
3221
|
+
def register(client); end
|
3222
|
+
|
3223
|
+
# source://puma//lib/puma/reactor.rb#69
|
3224
|
+
def select_loop; end
|
3225
|
+
|
3226
|
+
# 'Wake up' a monitored object by calling the provided block.
|
3227
|
+
# Stop monitoring the object if the block returns `true`.
|
3228
|
+
#
|
3229
|
+
# source://puma//lib/puma/reactor.rb#109
|
3230
|
+
def wakeup!(client); end
|
3231
|
+
end
|
3232
|
+
|
3233
|
+
# The methods here are included in Server, but are separated into this file.
|
3234
|
+
# All the methods here pertain to passing the request to the app, then
|
3235
|
+
# writing the response back to the client.
|
3236
|
+
#
|
3237
|
+
# None of the methods here are called externally, with the exception of
|
3238
|
+
# #handle_request, which is called in Server#process_client.
|
3239
|
+
#
|
3240
|
+
# @version 5.0.3
|
3241
|
+
module Puma::Request
|
3242
|
+
include ::Puma::Const
|
3243
|
+
|
3244
|
+
# @param env [Hash] see Puma::Client#env, from request
|
3245
|
+
# @return [Puma::Const::PORT_443, Puma::Const::PORT_80]
|
3246
|
+
#
|
3247
|
+
# source://puma//lib/puma/request.rb#230
|
3248
|
+
def default_server_port(env); end
|
3249
|
+
|
3250
|
+
# Takes the request contained in +client+, invokes the Rack application to construct
|
3251
|
+
# the response and writes it back to +client.io+.
|
3252
|
+
#
|
3253
|
+
# It'll return +false+ when the connection is closed, this doesn't mean
|
3254
|
+
# that the response wasn't successful.
|
3255
|
+
#
|
3256
|
+
# It'll return +:async+ if the connection remains open but will be handled
|
3257
|
+
# elsewhere, i.e. the connection has been hijacked by the Rack application.
|
3258
|
+
#
|
3259
|
+
# Finally, it'll return +true+ on keep-alive connections.
|
3260
|
+
#
|
3261
|
+
# @param client [Puma::Client]
|
3262
|
+
# @param io_buffer [Puma::IOBuffer]
|
3263
|
+
# @param requests [Integer]
|
3264
|
+
# @return [Boolean, :async]
|
3265
|
+
#
|
3266
|
+
# source://puma//lib/puma/request.rb#48
|
3267
|
+
def handle_request(client, io_buffer, requests); end
|
3268
|
+
|
3269
|
+
# Assembles the headers and prepares the body for actually sending the
|
3270
|
+
# response via #fast_write_response.
|
3271
|
+
#
|
3272
|
+
# @param status [Integer] the status returned by the Rack application
|
3273
|
+
# @param headers [Hash] the headers returned by the Rack application
|
3274
|
+
# @param app_body [Array] the body returned by the Rack application or
|
3275
|
+
# a call to `lowlevel_error`
|
3276
|
+
# @param io_buffer [Puma::IOBuffer] modified in place
|
3277
|
+
# @param requests [Integer] number of inline requests handled
|
3278
|
+
# @param client [Puma::Client]
|
3279
|
+
# @return [Boolean, :async]
|
3280
|
+
#
|
3281
|
+
# source://puma//lib/puma/request.rb#131
|
3282
|
+
def prepare_response(status, headers, app_body, io_buffer, requests, client); end
|
3283
|
+
|
3284
|
+
private
|
3285
|
+
|
3286
|
+
# Used to write headers and body.
|
3287
|
+
# Writes to a socket (normally `Client#io`) using `#fast_write_str`.
|
3288
|
+
# Accumulates `body` items into `io_buffer`, then writes to socket.
|
3289
|
+
#
|
3290
|
+
# @param socket [#write] the response socket
|
3291
|
+
# @param body [Enumerable, File] the body object
|
3292
|
+
# @param io_buffer [Puma::IOBuffer] contains headers
|
3293
|
+
# @param chunk [Boolean]
|
3294
|
+
# @raise [ConnectionError]
|
3295
|
+
#
|
3296
|
+
# source://puma//lib/puma/request.rb#273
|
3297
|
+
def fast_write_response(socket, body, io_buffer, chunked, content_length); end
|
3298
|
+
|
3299
|
+
# Used to write 'early hints', 'no body' responses, 'hijacked' responses,
|
3300
|
+
# and body segments (called by `fast_write_response`).
|
3301
|
+
# Writes a string to an io (normally `Client#io`) using `write_nonblock`.
|
3302
|
+
# Large strings may not be written in one pass, especially if `io` is a
|
3303
|
+
# `MiniSSL::Socket`.
|
3304
|
+
#
|
3305
|
+
# @param io [#write_nonblock] the io to write to
|
3306
|
+
# @param str [String] the string written to the io
|
3307
|
+
# @raise [ConnectionError]
|
3308
|
+
#
|
3309
|
+
# source://puma//lib/puma/request.rb#247
|
3310
|
+
def fast_write_str(socket, str); end
|
3311
|
+
|
3312
|
+
# @param status [Integer] status from the app
|
3313
|
+
# @return [String] the text description from Puma::HTTP_STATUS_CODES
|
3314
|
+
#
|
3315
|
+
# source://puma//lib/puma/request.rb#487
|
3316
|
+
def fetch_status_code(status); end
|
3317
|
+
|
3318
|
+
# @param header_key [#to_s]
|
3319
|
+
# @return [Boolean]
|
3320
|
+
#
|
3321
|
+
# source://puma//lib/puma/request.rb#413
|
3322
|
+
def illegal_header_key?(header_key); end
|
3323
|
+
|
3324
|
+
# @param header_value [#to_s]
|
3325
|
+
# @return [Boolean]
|
3326
|
+
#
|
3327
|
+
# source://puma//lib/puma/request.rb#420
|
3328
|
+
def illegal_header_value?(header_value); end
|
3329
|
+
|
3330
|
+
# Given a Hash +env+ for the request read from +client+, add
|
3331
|
+
# and fixup keys to comply with Rack's env guidelines.
|
3332
|
+
#
|
3333
|
+
# @param env [Hash] see Puma::Client#env, from request
|
3334
|
+
# @param client [Puma::Client] only needed for Client#peerip
|
3335
|
+
#
|
3336
|
+
# source://puma//lib/puma/request.rb#340
|
3337
|
+
def normalize_env(env, client); end
|
3338
|
+
|
3339
|
+
# Fixup any headers with `,` in the name to have `_` now. We emit
|
3340
|
+
# headers with `,` in them during the parse phase to avoid ambiguity
|
3341
|
+
# with the `-` to `_` conversion for critical headers. But here for
|
3342
|
+
# compatibility, we'll convert them back. This code is written to
|
3343
|
+
# avoid allocation in the common case (ie there are no headers
|
3344
|
+
# with `,` in their names), that's why it has the extra conditionals.
|
3345
|
+
#
|
3346
|
+
# @param env [Hash] see Puma::Client#env, from request, modifies in place
|
3347
|
+
# @version 5.0.3
|
3348
|
+
#
|
3349
|
+
# source://puma//lib/puma/request.rb#434
|
3350
|
+
def req_env_post_parse(env); end
|
3351
|
+
|
3352
|
+
# Used in the lambda for env[ `Puma::Const::EARLY_HINTS` ]
|
3353
|
+
#
|
3354
|
+
# @param headers [Hash] the headers returned by the Rack application
|
3355
|
+
# @return [String]
|
3356
|
+
# @version 5.0.3
|
3357
|
+
#
|
3358
|
+
# source://puma//lib/puma/request.rb#466
|
3359
|
+
def str_early_hints(headers); end
|
3360
|
+
|
3361
|
+
# Processes and write headers to the IOBuffer.
|
3362
|
+
#
|
3363
|
+
# @param env [Hash] see Puma::Client#env, from request
|
3364
|
+
# @param status [Integer] the status returned by the Rack application
|
3365
|
+
# @param headers [Hash] the headers returned by the Rack application
|
3366
|
+
# @param content_length [Integer, nil] content length if it can be determined from the
|
3367
|
+
# response body
|
3368
|
+
# @param io_buffer [Puma::IOBuffer] modified inn place
|
3369
|
+
# @param requests [Integer] number of inline requests handled
|
3370
|
+
# @param client [Puma::Client]
|
3371
|
+
# @return [Hash] resp_info
|
3372
|
+
# @version 5.0.3
|
3373
|
+
#
|
3374
|
+
# source://puma//lib/puma/request.rb#504
|
3375
|
+
def str_headers(env, status, headers, res_body, io_buffer, requests, client); end
|
3376
|
+
end
|
3377
|
+
|
3378
|
+
# determines whether to write body to io_buffer first, or straight to socket
|
3379
|
+
# also fixes max size of chunked body read when bosy is an IO.
|
3380
|
+
#
|
3381
|
+
# source://puma//lib/puma/request.rb#19
|
3382
|
+
Puma::Request::BODY_LEN_MAX = T.let(T.unsafe(nil), Integer)
|
3383
|
+
|
3384
|
+
# source://puma//lib/puma/request.rb#29
|
3385
|
+
Puma::Request::CUSTOM_STAT = T.let(T.unsafe(nil), String)
|
3386
|
+
|
3387
|
+
# size divide for using copy_stream on body
|
3388
|
+
#
|
3389
|
+
# source://puma//lib/puma/request.rb#22
|
3390
|
+
Puma::Request::IO_BODY_MAX = T.let(T.unsafe(nil), Integer)
|
3391
|
+
|
3392
|
+
# max size for io_buffer, force write when exceeded
|
3393
|
+
#
|
3394
|
+
# source://puma//lib/puma/request.rb#25
|
3395
|
+
Puma::Request::IO_BUFFER_LEN_MAX = T.let(T.unsafe(nil), Integer)
|
3396
|
+
|
3397
|
+
# source://puma//lib/puma/request.rb#27
|
3398
|
+
Puma::Request::SOCKET_WRITE_ERR_MSG = T.let(T.unsafe(nil), String)
|
3399
|
+
|
3400
|
+
# Generic class that is used by `Puma::Cluster` and `Puma::Single` to
|
3401
|
+
# serve requests. This class spawns a new instance of `Puma::Server` via
|
3402
|
+
# a call to `start_server`.
|
3403
|
+
class Puma::Runner
|
3404
|
+
# @return [Runner] a new instance of Runner
|
3405
|
+
#
|
3406
|
+
# source://puma//lib/puma/runner.rb#11
|
3407
|
+
def initialize(launcher); end
|
3408
|
+
|
3409
|
+
# source://puma//lib/puma/runner.rb#168
|
3410
|
+
def app; end
|
3411
|
+
|
3412
|
+
# @version 5.0.0
|
3413
|
+
#
|
3414
|
+
# source://puma//lib/puma/runner.rb#85
|
3415
|
+
def close_control_listeners; end
|
3416
|
+
|
3417
|
+
# source://puma//lib/puma/runner.rb#57
|
3418
|
+
def debug(str); end
|
3419
|
+
|
3420
|
+
# @return [Boolean]
|
3421
|
+
#
|
3422
|
+
# source://puma//lib/puma/runner.rb#36
|
3423
|
+
def development?; end
|
3424
|
+
|
3425
|
+
# source://puma//lib/puma/runner.rb#53
|
3426
|
+
def error(str); end
|
3427
|
+
|
3428
|
+
# source://puma//lib/puma/runner.rb#151
|
3429
|
+
def load_and_bind; end
|
3430
|
+
|
3431
|
+
# source://puma//lib/puma/runner.rb#44
|
3432
|
+
def log(str); end
|
3433
|
+
|
3434
|
+
# Returns the hash of configuration options.
|
3435
|
+
#
|
3436
|
+
# @return [Puma::UserFileDefaultOptions]
|
3437
|
+
#
|
3438
|
+
# source://puma//lib/puma/runner.rb#25
|
3439
|
+
def options; end
|
3440
|
+
|
3441
|
+
# source://puma//lib/puma/runner.rb#102
|
3442
|
+
def output_header(mode); end
|
3443
|
+
|
3444
|
+
# source://puma//lib/puma/runner.rb#124
|
3445
|
+
def redirect_io; end
|
3446
|
+
|
3447
|
+
# @return [Boolean]
|
3448
|
+
#
|
3449
|
+
# source://puma//lib/puma/runner.rb#120
|
3450
|
+
def redirected_io?; end
|
3451
|
+
|
3452
|
+
# source://puma//lib/puma/runner.rb#90
|
3453
|
+
def ruby_engine; end
|
3454
|
+
|
3455
|
+
# source://puma//lib/puma/runner.rb#61
|
3456
|
+
def start_control; end
|
3457
|
+
|
3458
|
+
# source://puma//lib/puma/runner.rb#172
|
3459
|
+
def start_server; end
|
3460
|
+
|
3461
|
+
# @version 5.0.0
|
3462
|
+
#
|
3463
|
+
# source://puma//lib/puma/runner.rb#49
|
3464
|
+
def stop_control; end
|
3465
|
+
|
3466
|
+
# @return [Boolean]
|
3467
|
+
#
|
3468
|
+
# source://puma//lib/puma/runner.rb#40
|
3469
|
+
def test?; end
|
3470
|
+
|
3471
|
+
# source://puma//lib/puma/runner.rb#27
|
3472
|
+
def wakeup!; end
|
3473
|
+
|
3474
|
+
private
|
3475
|
+
|
3476
|
+
# source://puma//lib/puma/runner.rb#179
|
3477
|
+
def ensure_output_directory_exists(path, io_name); end
|
3478
|
+
|
3479
|
+
# source://puma//lib/puma/runner.rb#185
|
3480
|
+
def stats; end
|
3481
|
+
end
|
3482
|
+
|
3483
|
+
# For some HTTP status codes the client only expects headers.
|
3484
|
+
#
|
3485
|
+
# source://puma//lib/puma/const.rb#84
|
3486
|
+
Puma::STATUS_WITH_NO_ENTITY_BODY = T.let(T.unsafe(nil), Hash)
|
3487
|
+
|
3488
|
+
# The HTTP Server itself. Serves out a single Rack app.
|
3489
|
+
#
|
3490
|
+
# This class is used by the `Puma::Single` and `Puma::Cluster` classes
|
3491
|
+
# to generate one or more `Puma::Server` instances capable of handling requests.
|
3492
|
+
# Each Puma process will contain one `Puma::Server` instance.
|
3493
|
+
#
|
3494
|
+
# The `Puma::Server` instance pulls requests from the socket, adds them to a
|
3495
|
+
# `Puma::Reactor` where they get eventually passed to a `Puma::ThreadPool`.
|
3496
|
+
#
|
3497
|
+
# Each `Puma::Server` will have one reactor and one thread pool.
|
3498
|
+
class Puma::Server
|
3499
|
+
include ::Puma::Const
|
3500
|
+
include ::Puma::Request
|
3501
|
+
extend ::Forwardable
|
3502
|
+
|
3503
|
+
# Create a server for the rack app +app+.
|
3504
|
+
#
|
3505
|
+
# +log_writer+ is a Puma::LogWriter object used to log info and error messages.
|
3506
|
+
#
|
3507
|
+
# +events+ is a Puma::Events object used to notify application status events.
|
3508
|
+
#
|
3509
|
+
# Server#run returns a thread that you can join on to wait for the server
|
3510
|
+
# to do its work.
|
3511
|
+
#
|
3512
|
+
# @note Several instance variables exist so they are available for testing,
|
3513
|
+
# and have default values set via +fetch+. Normally the values are set via
|
3514
|
+
# `::Puma::Configuration.puma_default_options`.
|
3515
|
+
# @note The `events` parameter is set to nil, and set to `Events.new` in code.
|
3516
|
+
# Often `options` needs to be passed, but `events` does not. Using nil allows
|
3517
|
+
# calling code to not require events.rb.
|
3518
|
+
# @return [Server] a new instance of Server
|
3519
|
+
#
|
3520
|
+
# source://puma//lib/puma/server.rb#74
|
3521
|
+
def initialize(app, events = T.unsafe(nil), options = T.unsafe(nil)); end
|
3522
|
+
|
3523
|
+
# source://forwardable/1.3.2/forwardable.rb#229
|
3524
|
+
def add_ssl_listener(*args, **_arg1, &block); end
|
3525
|
+
|
3526
|
+
# source://forwardable/1.3.2/forwardable.rb#229
|
3527
|
+
def add_tcp_listener(*args, **_arg1, &block); end
|
3528
|
+
|
3529
|
+
# source://forwardable/1.3.2/forwardable.rb#229
|
3530
|
+
def add_unix_listener(*args, **_arg1, &block); end
|
3531
|
+
|
3532
|
+
# Returns the value of attribute app.
|
3533
|
+
#
|
3534
|
+
# source://puma//lib/puma/server.rb#49
|
3535
|
+
def app; end
|
3536
|
+
|
3537
|
+
# Sets the attribute app
|
3538
|
+
#
|
3539
|
+
# @param value the value to set the attribute app to.
|
3540
|
+
#
|
3541
|
+
# source://puma//lib/puma/server.rb#49
|
3542
|
+
def app=(_arg0); end
|
3543
|
+
|
3544
|
+
# @todo the following may be deprecated in the future
|
3545
|
+
#
|
3546
|
+
# source://puma//lib/puma/server.rb#45
|
3547
|
+
def auto_trim_time; end
|
3548
|
+
|
3549
|
+
# source://puma//lib/puma/server.rb#198
|
3550
|
+
def backlog; end
|
3551
|
+
|
3552
|
+
# source://puma//lib/puma/server.rb#596
|
3553
|
+
def begin_restart(sync = T.unsafe(nil)); end
|
3554
|
+
|
3555
|
+
# Returns the value of attribute binder.
|
3556
|
+
#
|
3557
|
+
# source://puma//lib/puma/server.rb#50
|
3558
|
+
def binder; end
|
3559
|
+
|
3560
|
+
# Sets the attribute binder
|
3561
|
+
#
|
3562
|
+
# @param value the value to set the attribute binder to.
|
3563
|
+
#
|
3564
|
+
# source://puma//lib/puma/server.rb#50
|
3565
|
+
def binder=(_arg0); end
|
3566
|
+
|
3567
|
+
# Handle various error types thrown by Client I/O operations.
|
3568
|
+
#
|
3569
|
+
# source://puma//lib/puma/server.rb#496
|
3570
|
+
def client_error(e, client); end
|
3571
|
+
|
3572
|
+
# @return [Boolean]
|
3573
|
+
#
|
3574
|
+
# source://puma//lib/puma/server.rb#192
|
3575
|
+
def closed_socket?(socket); end
|
3576
|
+
|
3577
|
+
# source://forwardable/1.3.2/forwardable.rb#229
|
3578
|
+
def connected_ports(*args, **_arg1, &block); end
|
3579
|
+
|
3580
|
+
# 6 == Socket::IPPROTO_TCP
|
3581
|
+
# 3 == TCP_CORK
|
3582
|
+
# 1/0 == turn on/off
|
3583
|
+
#
|
3584
|
+
# source://puma//lib/puma/server.rb#165
|
3585
|
+
def cork_socket(socket); end
|
3586
|
+
|
3587
|
+
# @todo the following may be deprecated in the future
|
3588
|
+
#
|
3589
|
+
# source://puma//lib/puma/server.rb#45
|
3590
|
+
def early_hints; end
|
3591
|
+
|
3592
|
+
# Returns the value of attribute events.
|
3593
|
+
#
|
3594
|
+
# source://puma//lib/puma/server.rb#40
|
3595
|
+
def events; end
|
3596
|
+
|
3597
|
+
# @todo the following may be deprecated in the future
|
3598
|
+
#
|
3599
|
+
# source://puma//lib/puma/server.rb#45
|
3600
|
+
def first_data_timeout; end
|
3601
|
+
|
3602
|
+
# Wait for all outstanding requests to finish.
|
3603
|
+
#
|
3604
|
+
# source://puma//lib/puma/server.rb#539
|
3605
|
+
def graceful_shutdown; end
|
3606
|
+
|
3607
|
+
# source://puma//lib/puma/server.rb#591
|
3608
|
+
def halt(sync = T.unsafe(nil)); end
|
3609
|
+
|
3610
|
+
# source://puma//lib/puma/server.rb#376
|
3611
|
+
def handle_check; end
|
3612
|
+
|
3613
|
+
# source://puma//lib/puma/server.rb#300
|
3614
|
+
def handle_servers; end
|
3615
|
+
|
3616
|
+
# source://puma//lib/puma/server.rb#114
|
3617
|
+
def inherit_binder(bind); end
|
3618
|
+
|
3619
|
+
# @todo the following may be deprecated in the future
|
3620
|
+
#
|
3621
|
+
# source://puma//lib/puma/server.rb#45
|
3622
|
+
def leak_stack_on_error; end
|
3623
|
+
|
3624
|
+
# Returns the value of attribute log_writer.
|
3625
|
+
#
|
3626
|
+
# source://puma//lib/puma/server.rb#39
|
3627
|
+
def log_writer; end
|
3628
|
+
|
3629
|
+
# A fallback rack response if +@app+ raises as exception.
|
3630
|
+
#
|
3631
|
+
# source://puma//lib/puma/server.rb#518
|
3632
|
+
def lowlevel_error(e, env, status = T.unsafe(nil)); end
|
3633
|
+
|
3634
|
+
# for #stats
|
3635
|
+
#
|
3636
|
+
# source://puma//lib/puma/server.rb#41
|
3637
|
+
def max_threads; end
|
3638
|
+
|
3639
|
+
# for #stats
|
3640
|
+
#
|
3641
|
+
# source://puma//lib/puma/server.rb#41
|
3642
|
+
def min_threads; end
|
3643
|
+
|
3644
|
+
# @todo the following may be deprecated in the future
|
3645
|
+
#
|
3646
|
+
# source://puma//lib/puma/server.rb#45
|
3647
|
+
def persistent_timeout; end
|
3648
|
+
|
3649
|
+
# This number represents the number of requests that
|
3650
|
+
# the server is capable of taking right now.
|
3651
|
+
#
|
3652
|
+
# For example if the number is 5 then it means
|
3653
|
+
# there are 5 threads sitting idle ready to take
|
3654
|
+
# a request. If one request comes in, then the
|
3655
|
+
# value would be 4 until it finishes processing.
|
3656
|
+
#
|
3657
|
+
# source://puma//lib/puma/server.rb#216
|
3658
|
+
def pool_capacity; end
|
3659
|
+
|
3660
|
+
# Given a connection on +client+, handle the incoming requests,
|
3661
|
+
# or queue the connection in the Reactor if no request is available.
|
3662
|
+
#
|
3663
|
+
# This method is called from a ThreadPool worker thread.
|
3664
|
+
#
|
3665
|
+
# This method supports HTTP Keep-Alive so it may, depending on if the client
|
3666
|
+
# indicates that it supports keep alive, wait for another request before
|
3667
|
+
# returning.
|
3668
|
+
#
|
3669
|
+
# Return true if one or more requests were processed.
|
3670
|
+
#
|
3671
|
+
# source://puma//lib/puma/server.rb#404
|
3672
|
+
def process_client(client, buffer); end
|
3673
|
+
|
3674
|
+
# This method is called from the Reactor thread when a queued Client receives data,
|
3675
|
+
# times out, or when the Reactor is shutting down.
|
3676
|
+
#
|
3677
|
+
# It is responsible for ensuring that a request has been completely received
|
3678
|
+
# before it starts to be processed by the ThreadPool. This may be known as read buffering.
|
3679
|
+
# If read buffering is not done, and no other read buffering is performed (such as by an application server
|
3680
|
+
# such as nginx) then the application would be subject to a slow client attack.
|
3681
|
+
#
|
3682
|
+
# For a graphical representation of how the request buffer works see [architecture.md](https://github.com/puma/puma/blob/master/docs/architecture.md#connection-pipeline).
|
3683
|
+
#
|
3684
|
+
# The method checks to see if it has the full header and body with
|
3685
|
+
# the `Puma::Client#try_to_finish` method. If the full request has been sent,
|
3686
|
+
# then the request is passed to the ThreadPool (`@thread_pool << client`)
|
3687
|
+
# so that a "worker thread" can pick up the request and begin to execute application logic.
|
3688
|
+
# The Client is then removed from the reactor (return `true`).
|
3689
|
+
#
|
3690
|
+
# If a client object times out, a 408 response is written, its connection is closed,
|
3691
|
+
# and the object is removed from the reactor (return `true`).
|
3692
|
+
#
|
3693
|
+
# If the Reactor is shutting down, all Clients are either timed out or passed to the
|
3694
|
+
# ThreadPool, depending on their current state (#can_close?).
|
3695
|
+
#
|
3696
|
+
# Otherwise, if the full request is not ready then the client will remain in the reactor
|
3697
|
+
# (return `false`). When the client sends more data to the socket the `Puma::Client` object
|
3698
|
+
# will wake up and again be checked to see if it's ready to be passed to the thread pool.
|
3699
|
+
#
|
3700
|
+
# source://puma//lib/puma/server.rb#284
|
3701
|
+
def reactor_wakeup(client); end
|
3702
|
+
|
3703
|
+
# @todo the following may be deprecated in the future
|
3704
|
+
#
|
3705
|
+
# source://puma//lib/puma/server.rb#45
|
3706
|
+
def reaping_time; end
|
3707
|
+
|
3708
|
+
# @version 5.0.0
|
3709
|
+
#
|
3710
|
+
# source://puma//lib/puma/server.rb#42
|
3711
|
+
def requests_count; end
|
3712
|
+
|
3713
|
+
# Runs the server.
|
3714
|
+
#
|
3715
|
+
# If +background+ is true (the default) then a thread is spun
|
3716
|
+
# up in the background to handle requests. Otherwise requests
|
3717
|
+
# are handled synchronously.
|
3718
|
+
#
|
3719
|
+
# source://puma//lib/puma/server.rb#226
|
3720
|
+
def run(background = T.unsafe(nil), thread_name: T.unsafe(nil)); end
|
3721
|
+
|
3722
|
+
# source://puma//lib/puma/server.rb#203
|
3723
|
+
def running; end
|
3724
|
+
|
3725
|
+
# @return [Boolean]
|
3726
|
+
#
|
3727
|
+
# source://puma//lib/puma/server.rb#601
|
3728
|
+
def shutting_down?; end
|
3729
|
+
|
3730
|
+
# Returns a hash of stats about the running server for reporting purposes.
|
3731
|
+
#
|
3732
|
+
# @version 5.0.0
|
3733
|
+
#
|
3734
|
+
# source://puma//lib/puma/server.rb#612
|
3735
|
+
def stats; end
|
3736
|
+
|
3737
|
+
# Stops the acceptor thread and then causes the worker threads to finish
|
3738
|
+
# off the request queue before finally exiting.
|
3739
|
+
#
|
3740
|
+
# source://puma//lib/puma/server.rb#586
|
3741
|
+
def stop(sync = T.unsafe(nil)); end
|
3742
|
+
|
3743
|
+
# Returns the value of attribute thread.
|
3744
|
+
#
|
3745
|
+
# source://puma//lib/puma/server.rb#38
|
3746
|
+
def thread; end
|
3747
|
+
|
3748
|
+
# source://puma//lib/puma/server.rb#168
|
3749
|
+
def uncork_socket(socket); end
|
3750
|
+
|
3751
|
+
# Triggers a client timeout if the thread-pool shuts down
|
3752
|
+
# during execution of the provided block.
|
3753
|
+
#
|
3754
|
+
# source://puma//lib/puma/server.rb#487
|
3755
|
+
def with_force_shutdown(client, &block); end
|
3756
|
+
|
3757
|
+
private
|
3758
|
+
|
3759
|
+
# source://puma//lib/puma/server.rb#568
|
3760
|
+
def notify_safely(message); end
|
3761
|
+
|
3762
|
+
class << self
|
3763
|
+
# source://puma//lib/puma/server.rb#120
|
3764
|
+
def current; end
|
3765
|
+
|
3766
|
+
private
|
3767
|
+
|
3768
|
+
# @return [Boolean]
|
3769
|
+
# @version 5.0.0
|
3770
|
+
#
|
3771
|
+
# source://puma//lib/puma/server.rb#132
|
3772
|
+
def closed_socket_supported?; end
|
3773
|
+
|
3774
|
+
# @return [Boolean]
|
3775
|
+
# @version 5.0.0
|
3776
|
+
#
|
3777
|
+
# source://puma//lib/puma/server.rb#126
|
3778
|
+
def tcp_cork_supported?; end
|
3779
|
+
end
|
3780
|
+
end
|
3781
|
+
|
3782
|
+
# List of methods invoked by #stats.
|
3783
|
+
#
|
3784
|
+
# @version 5.0.0
|
3785
|
+
#
|
3786
|
+
# source://puma//lib/puma/server.rb#607
|
3787
|
+
Puma::Server::STAT_METHODS = T.let(T.unsafe(nil), Array)
|
3788
|
+
|
3789
|
+
# source://puma//lib/puma/server.rb#55
|
3790
|
+
Puma::Server::ThreadLocalKey = T.let(T.unsafe(nil), Symbol)
|
3791
|
+
|
3792
|
+
# This class is instantiated by the `Puma::Launcher` and used
|
3793
|
+
# to boot and serve a Ruby application when no puma "workers" are needed
|
3794
|
+
# i.e. only using "threaded" mode. For example `$ puma -t 1:5`
|
3795
|
+
#
|
3796
|
+
# At the core of this class is running an instance of `Puma::Server` which
|
3797
|
+
# gets created via the `start_server` method from the `Puma::Runner` class
|
3798
|
+
# that this inherits from.
|
3799
|
+
class Puma::Single < ::Puma::Runner
|
3800
|
+
# source://puma//lib/puma/single.rb#31
|
3801
|
+
def halt; end
|
3802
|
+
|
3803
|
+
# source://puma//lib/puma/single.rb#23
|
3804
|
+
def restart; end
|
3805
|
+
|
3806
|
+
# source://puma//lib/puma/single.rb#41
|
3807
|
+
def run; end
|
3808
|
+
|
3809
|
+
# source://puma//lib/puma/single.rb#17
|
3810
|
+
def stats; end
|
3811
|
+
|
3812
|
+
# source://puma//lib/puma/single.rb#27
|
3813
|
+
def stop; end
|
3814
|
+
|
3815
|
+
# source://puma//lib/puma/single.rb#35
|
3816
|
+
def stop_blocked; end
|
3817
|
+
end
|
3818
|
+
|
3819
|
+
# Internal Docs for A simple thread pool management object.
|
3820
|
+
#
|
3821
|
+
# Each Puma "worker" has a thread pool to process requests.
|
3822
|
+
#
|
3823
|
+
# First a connection to a client is made in `Puma::Server`. It is wrapped in a
|
3824
|
+
# `Puma::Client` instance and then passed to the `Puma::Reactor` to ensure
|
3825
|
+
# the whole request is buffered into memory. Once the request is ready, it is passed into
|
3826
|
+
# a thread pool via the `Puma::ThreadPool#<<` operator where it is stored in a `@todo` array.
|
3827
|
+
#
|
3828
|
+
# Each thread in the pool has an internal loop where it pulls a request from the `@todo` array
|
3829
|
+
# and processes it.
|
3830
|
+
class Puma::ThreadPool
|
3831
|
+
# Maintain a minimum of +min+ and maximum of +max+ threads
|
3832
|
+
# in the pool.
|
3833
|
+
#
|
3834
|
+
# The block passed is the work that will be performed in each
|
3835
|
+
# thread.
|
3836
|
+
#
|
3837
|
+
# @return [ThreadPool] a new instance of ThreadPool
|
3838
|
+
#
|
3839
|
+
# source://puma//lib/puma/thread_pool.rb#34
|
3840
|
+
def initialize(name, options = T.unsafe(nil), &block); end
|
3841
|
+
|
3842
|
+
# Add +work+ to the todo list for a Thread to pickup and process.
|
3843
|
+
#
|
3844
|
+
# source://puma//lib/puma/thread_pool.rb#188
|
3845
|
+
def <<(work); end
|
3846
|
+
|
3847
|
+
# source://puma//lib/puma/thread_pool.rb#330
|
3848
|
+
def auto_reap!(timeout = T.unsafe(nil)); end
|
3849
|
+
|
3850
|
+
# source://puma//lib/puma/thread_pool.rb#325
|
3851
|
+
def auto_trim!(timeout = T.unsafe(nil)); end
|
3852
|
+
|
3853
|
+
# How many objects have yet to be processed by the pool?
|
3854
|
+
#
|
3855
|
+
# source://puma//lib/puma/thread_pool.rb#85
|
3856
|
+
def backlog; end
|
3857
|
+
|
3858
|
+
# @version 5.0.0
|
3859
|
+
#
|
3860
|
+
# source://puma//lib/puma/thread_pool.rb#96
|
3861
|
+
def busy_threads; end
|
3862
|
+
|
3863
|
+
# source://puma//lib/puma/thread_pool.rb#90
|
3864
|
+
def pool_capacity; end
|
3865
|
+
|
3866
|
+
# If there are dead threads in the pool make them go away while decreasing
|
3867
|
+
# spawned counter so that new healthy threads could be created again.
|
3868
|
+
#
|
3869
|
+
# source://puma//lib/puma/thread_pool.rb#283
|
3870
|
+
def reap; end
|
3871
|
+
|
3872
|
+
# Tell all threads in the pool to exit and wait for them to finish.
|
3873
|
+
# Wait +timeout+ seconds then raise +ForceShutdown+ in remaining threads.
|
3874
|
+
# Next, wait an extra +grace+ seconds then force-kill remaining threads.
|
3875
|
+
# Finally, wait +kill_grace+ seconds for remaining threads to exit.
|
3876
|
+
#
|
3877
|
+
# source://puma//lib/puma/thread_pool.rb#353
|
3878
|
+
def shutdown(timeout = T.unsafe(nil)); end
|
3879
|
+
|
3880
|
+
# Returns the value of attribute spawned.
|
3881
|
+
#
|
3882
|
+
# source://puma//lib/puma/thread_pool.rb#75
|
3883
|
+
def spawned; end
|
3884
|
+
|
3885
|
+
# If there are any free threads in the pool, tell one to go ahead
|
3886
|
+
# and exit. If +force+ is true, then a trim request is requested
|
3887
|
+
# even if all threads are being utilized.
|
3888
|
+
#
|
3889
|
+
# source://puma//lib/puma/thread_pool.rb#271
|
3890
|
+
def trim(force = T.unsafe(nil)); end
|
3891
|
+
|
3892
|
+
# Returns the value of attribute trim_requested.
|
3893
|
+
#
|
3894
|
+
# source://puma//lib/puma/thread_pool.rb#75
|
3895
|
+
def trim_requested; end
|
3896
|
+
|
3897
|
+
# @version 5.0.0
|
3898
|
+
#
|
3899
|
+
# source://puma//lib/puma/thread_pool.rb#247
|
3900
|
+
def wait_for_less_busy_worker(delay_s); end
|
3901
|
+
|
3902
|
+
# This method is used by `Puma::Server` to let the server know when
|
3903
|
+
# the thread pool can pull more requests from the socket and
|
3904
|
+
# pass to the reactor.
|
3905
|
+
#
|
3906
|
+
# The general idea is that the thread pool can only work on a fixed
|
3907
|
+
# number of requests at the same time. If it is already processing that
|
3908
|
+
# number of requests then it is at capacity. If another Puma process has
|
3909
|
+
# spare capacity, then the request can be left on the socket so the other
|
3910
|
+
# worker can pick it up and process it.
|
3911
|
+
#
|
3912
|
+
# For example: if there are 5 threads, but only 4 working on
|
3913
|
+
# requests, this method will not wait and the `Puma::Server`
|
3914
|
+
# can pull a request right away.
|
3915
|
+
#
|
3916
|
+
# If there are 5 threads and all 5 of them are busy, then it will
|
3917
|
+
# pause here, and wait until the `not_full` condition variable is
|
3918
|
+
# signaled, usually this indicates that a request has been processed.
|
3919
|
+
#
|
3920
|
+
# It's important to note that even though the server might accept another
|
3921
|
+
# request, it might not be added to the `@todo` array right away.
|
3922
|
+
# For example if a slow client has only sent a header, but not a body
|
3923
|
+
# then the `@todo` array would stay the same size as the reactor works
|
3924
|
+
# to try to buffer the request. In that scenario the next call to this
|
3925
|
+
# method would not block and another request would be added into the reactor
|
3926
|
+
# by the server. This would continue until a fully buffered request
|
3927
|
+
# makes it through the reactor and can then be processed by the thread pool.
|
3928
|
+
#
|
3929
|
+
# source://puma//lib/puma/thread_pool.rb#230
|
3930
|
+
def wait_until_not_full; end
|
3931
|
+
|
3932
|
+
# Returns the value of attribute waiting.
|
3933
|
+
#
|
3934
|
+
# source://puma//lib/puma/thread_pool.rb#75
|
3935
|
+
def waiting; end
|
3936
|
+
|
3937
|
+
# Allows ThreadPool::ForceShutdown to be raised within the
|
3938
|
+
# provided block if the thread is forced to shutdown during execution.
|
3939
|
+
#
|
3940
|
+
# source://puma//lib/puma/thread_pool.rb#337
|
3941
|
+
def with_force_shutdown; end
|
3942
|
+
|
3943
|
+
# @version 5.0.0
|
3944
|
+
#
|
3945
|
+
# source://puma//lib/puma/thread_pool.rb#181
|
3946
|
+
def with_mutex(&block); end
|
3947
|
+
|
3948
|
+
private
|
3949
|
+
|
3950
|
+
#
|
3951
|
+
# Must be called with @mutex held!
|
3952
|
+
#
|
3953
|
+
# source://puma//lib/puma/thread_pool.rb#104
|
3954
|
+
def spawn_thread; end
|
3955
|
+
|
3956
|
+
# @version 5.0.0
|
3957
|
+
#
|
3958
|
+
# source://puma//lib/puma/thread_pool.rb#165
|
3959
|
+
def trigger_out_of_band_hook; end
|
3960
|
+
|
3961
|
+
class << self
|
3962
|
+
# source://puma//lib/puma/thread_pool.rb#77
|
3963
|
+
def clean_thread_locals; end
|
3964
|
+
end
|
3965
|
+
end
|
3966
|
+
|
3967
|
+
class Puma::ThreadPool::Automaton
|
3968
|
+
# @return [Automaton] a new instance of Automaton
|
3969
|
+
#
|
3970
|
+
# source://puma//lib/puma/thread_pool.rb#299
|
3971
|
+
def initialize(pool, timeout, thread_name, message); end
|
3972
|
+
|
3973
|
+
# source://puma//lib/puma/thread_pool.rb#307
|
3974
|
+
def start!; end
|
3975
|
+
|
3976
|
+
# source://puma//lib/puma/thread_pool.rb#319
|
3977
|
+
def stop; end
|
3978
|
+
end
|
3979
|
+
|
3980
|
+
class Puma::ThreadPool::ForceShutdown < ::RuntimeError; end
|
3981
|
+
|
3982
|
+
# How long, after raising the ForceShutdown of a thread during
|
3983
|
+
# forced shutdown mode, to wait for the thread to try and finish
|
3984
|
+
# up its work before leaving the thread to die on the vine.
|
3985
|
+
#
|
3986
|
+
# source://puma//lib/puma/thread_pool.rb#26
|
3987
|
+
Puma::ThreadPool::SHUTDOWN_GRACE_TIME = T.let(T.unsafe(nil), Integer)
|
3988
|
+
|
3989
|
+
class Puma::UnknownPlugin < ::RuntimeError; end
|
3990
|
+
class Puma::UnsupportedBackend < ::StandardError; end
|
3991
|
+
class Puma::UnsupportedOption < ::RuntimeError; end
|
3992
|
+
|
3993
|
+
# A class used for storing "leveled" configuration options.
|
3994
|
+
#
|
3995
|
+
# In this class any "user" specified options take precedence over any
|
3996
|
+
# "file" specified options, take precedence over any "default" options.
|
3997
|
+
#
|
3998
|
+
# User input is preferred over "defaults":
|
3999
|
+
# user_options = { foo: "bar" }
|
4000
|
+
# default_options = { foo: "zoo" }
|
4001
|
+
# options = UserFileDefaultOptions.new(user_options, default_options)
|
4002
|
+
# puts options[:foo]
|
4003
|
+
# # => "bar"
|
4004
|
+
#
|
4005
|
+
# All values can be accessed via `all_of`
|
4006
|
+
#
|
4007
|
+
# puts options.all_of(:foo)
|
4008
|
+
# # => ["bar", "zoo"]
|
4009
|
+
#
|
4010
|
+
# A "file" option can be set. This config will be preferred over "default" options
|
4011
|
+
# but will defer to any available "user" specified options.
|
4012
|
+
#
|
4013
|
+
# user_options = { foo: "bar" }
|
4014
|
+
# default_options = { rackup: "zoo.rb" }
|
4015
|
+
# options = UserFileDefaultOptions.new(user_options, default_options)
|
4016
|
+
# options.file_options[:rackup] = "sup.rb"
|
4017
|
+
# puts options[:rackup]
|
4018
|
+
# # => "sup.rb"
|
4019
|
+
#
|
4020
|
+
# The "default" options can be set via procs. These are resolved during runtime
|
4021
|
+
# via calls to `finalize_values`
|
4022
|
+
class Puma::UserFileDefaultOptions
|
4023
|
+
# @return [UserFileDefaultOptions] a new instance of UserFileDefaultOptions
|
4024
|
+
#
|
4025
|
+
# source://puma//lib/puma/configuration.rb#39
|
4026
|
+
def initialize(user_options, default_options); end
|
4027
|
+
|
4028
|
+
# source://puma//lib/puma/configuration.rb#47
|
4029
|
+
def [](key); end
|
4030
|
+
|
4031
|
+
# source://puma//lib/puma/configuration.rb#51
|
4032
|
+
def []=(key, value); end
|
4033
|
+
|
4034
|
+
# source://puma//lib/puma/configuration.rb#63
|
4035
|
+
def all_of(key); end
|
4036
|
+
|
4037
|
+
# Returns the value of attribute default_options.
|
4038
|
+
#
|
4039
|
+
# source://puma//lib/puma/configuration.rb#45
|
4040
|
+
def default_options; end
|
4041
|
+
|
4042
|
+
# source://puma//lib/puma/configuration.rb#55
|
4043
|
+
def fetch(key, default_value = T.unsafe(nil)); end
|
4044
|
+
|
4045
|
+
# Returns the value of attribute file_options.
|
4046
|
+
#
|
4047
|
+
# source://puma//lib/puma/configuration.rb#45
|
4048
|
+
def file_options; end
|
4049
|
+
|
4050
|
+
# source://puma//lib/puma/configuration.rb#87
|
4051
|
+
def final_options; end
|
4052
|
+
|
4053
|
+
# source://puma//lib/puma/configuration.rb#79
|
4054
|
+
def finalize_values; end
|
4055
|
+
|
4056
|
+
# Returns the value of attribute user_options.
|
4057
|
+
#
|
4058
|
+
# source://puma//lib/puma/configuration.rb#45
|
4059
|
+
def user_options; end
|
4060
|
+
end
|
4061
|
+
|
4062
|
+
module Puma::Util
|
4063
|
+
private
|
4064
|
+
|
4065
|
+
# source://puma//lib/puma/util.rb#24
|
4066
|
+
def escape(s, encoding = T.unsafe(nil)); end
|
4067
|
+
|
4068
|
+
# Stolen from Mongrel, with some small modifications:
|
4069
|
+
# Parses a query string by breaking it up at the '&'
|
4070
|
+
# and ';' characters. You can also use this to parse
|
4071
|
+
# cookies by changing the characters used in the second
|
4072
|
+
# parameter (which defaults to '&;').
|
4073
|
+
#
|
4074
|
+
# source://puma//lib/puma/util.rb#49
|
4075
|
+
def parse_query(qs, d = T.unsafe(nil), &unescaper); end
|
4076
|
+
|
4077
|
+
# source://puma//lib/puma/util.rb#9
|
4078
|
+
def pipe; end
|
4079
|
+
|
4080
|
+
# An instance method on Thread has been provided to address https://bugs.ruby-lang.org/issues/13632,
|
4081
|
+
# which currently effects some older versions of Ruby: 2.2.7 2.2.8 2.2.9 2.2.10 2.3.4 2.4.1
|
4082
|
+
# Additional context: https://github.com/puma/puma/pull/1345
|
4083
|
+
#
|
4084
|
+
# source://puma//lib/puma/util.rb#16
|
4085
|
+
def purge_interrupt_queue; end
|
4086
|
+
|
4087
|
+
# source://puma//lib/puma/util.rb#28
|
4088
|
+
def unescape(s, encoding = T.unsafe(nil)); end
|
4089
|
+
|
4090
|
+
class << self
|
4091
|
+
# source://puma//lib/puma/util.rb#24
|
4092
|
+
def escape(s, encoding = T.unsafe(nil)); end
|
4093
|
+
|
4094
|
+
# Stolen from Mongrel, with some small modifications:
|
4095
|
+
# Parses a query string by breaking it up at the '&'
|
4096
|
+
# and ';' characters. You can also use this to parse
|
4097
|
+
# cookies by changing the characters used in the second
|
4098
|
+
# parameter (which defaults to '&;').
|
4099
|
+
#
|
4100
|
+
# source://puma//lib/puma/util.rb#49
|
4101
|
+
def parse_query(qs, d = T.unsafe(nil), &unescaper); end
|
4102
|
+
|
4103
|
+
# source://puma//lib/puma/util.rb#9
|
4104
|
+
def pipe; end
|
4105
|
+
|
4106
|
+
# An instance method on Thread has been provided to address https://bugs.ruby-lang.org/issues/13632,
|
4107
|
+
# which currently effects some older versions of Ruby: 2.2.7 2.2.8 2.2.9 2.2.10 2.3.4 2.4.1
|
4108
|
+
# Additional context: https://github.com/puma/puma/pull/1345
|
4109
|
+
#
|
4110
|
+
# source://puma//lib/puma/util.rb#16
|
4111
|
+
def purge_interrupt_queue; end
|
4112
|
+
|
4113
|
+
# source://puma//lib/puma/util.rb#28
|
4114
|
+
def unescape(s, encoding = T.unsafe(nil)); end
|
4115
|
+
end
|
4116
|
+
end
|
4117
|
+
|
4118
|
+
# source://puma//lib/puma/util.rb#42
|
4119
|
+
Puma::Util::DEFAULT_SEP = T.let(T.unsafe(nil), Regexp)
|
4120
|
+
|
4121
|
+
# A case-insensitive Hash that preserves the original case of a
|
4122
|
+
# header when set.
|
4123
|
+
class Puma::Util::HeaderHash < ::Hash
|
4124
|
+
# @return [HeaderHash] a new instance of HeaderHash
|
4125
|
+
#
|
4126
|
+
# source://puma//lib/puma/util.rb#79
|
4127
|
+
def initialize(hash = T.unsafe(nil)); end
|
4128
|
+
|
4129
|
+
# source://puma//lib/puma/util.rb#98
|
4130
|
+
def [](k); end
|
4131
|
+
|
4132
|
+
# source://puma//lib/puma/util.rb#102
|
4133
|
+
def []=(k, v); end
|
4134
|
+
|
4135
|
+
# source://puma//lib/puma/util.rb#109
|
4136
|
+
def delete(k); end
|
4137
|
+
|
4138
|
+
# source://puma//lib/puma/util.rb#85
|
4139
|
+
def each; end
|
4140
|
+
|
4141
|
+
# @return [Boolean]
|
4142
|
+
#
|
4143
|
+
# source://puma//lib/puma/util.rb#116
|
4144
|
+
def has_key?(k); end
|
4145
|
+
|
4146
|
+
# @return [Boolean]
|
4147
|
+
#
|
4148
|
+
# source://puma//lib/puma/util.rb#116
|
4149
|
+
def include?(k); end
|
4150
|
+
|
4151
|
+
# @return [Boolean]
|
4152
|
+
#
|
4153
|
+
# source://puma//lib/puma/util.rb#116
|
4154
|
+
def key?(k); end
|
4155
|
+
|
4156
|
+
# @return [Boolean]
|
4157
|
+
#
|
4158
|
+
# source://puma//lib/puma/util.rb#116
|
4159
|
+
def member?(k); end
|
4160
|
+
|
4161
|
+
# source://puma//lib/puma/util.rb#129
|
4162
|
+
def merge(other); end
|
4163
|
+
|
4164
|
+
# source://puma//lib/puma/util.rb#124
|
4165
|
+
def merge!(other); end
|
4166
|
+
|
4167
|
+
# source://puma//lib/puma/util.rb#134
|
4168
|
+
def replace(other); end
|
4169
|
+
|
4170
|
+
# source://puma//lib/puma/util.rb#92
|
4171
|
+
def to_hash; end
|
4172
|
+
|
4173
|
+
class << self
|
4174
|
+
# source://puma//lib/puma/util.rb#75
|
4175
|
+
def new(hash = T.unsafe(nil)); end
|
4176
|
+
end
|
4177
|
+
end
|