Class: HTTP2::Settings
- Inherits:
-
Struct
- Object
- Struct
- HTTP2::Settings
- Defined in:
- sig/settings.rbs,
lib/http/2/settings.rb
Overview
Container for all settings required for the management of an HTTP/2 connection. This includes the managemenet of the settings negotiated via the SETTINGS frame, as well as user-level configuration related with header compression.
Instance Attribute Summary collapse
-
#huffman ⇒ huffman_type
controls how to use huffman encoding to encode strings.
-
#index ⇒ index_type
controls the configuration of the HPACK indexing tables:.
-
#settings_enable_push ⇒ Integer
can be used to disable server push (set to 0).
-
#settings_header_table_size ⇒ Integer
maximum size of the header compression table used to decode header blocks, in bytes.
-
#settings_initial_window_size ⇒ Integer
initial window size (in bytes) for stream-level flow control.
-
#settings_max_concurrent_streams ⇒ Integer
maximum number of concurrent streams that the sender will allow.
-
#settings_max_frame_size ⇒ Integer
max size of for payload that the sender is willing to receive, in bytes.
-
#settings_max_header_list_size ⇒ Object
Returns the value of attribute settings_max_header_list_size.
-
#table_size ⇒ Integer
maximum dynamic table size in bytes.
Instance Method Summary collapse
-
#connection_settings {|arg0, arg1| ... } ⇒ Object
yields connection-level settings only.
-
#initialize(settings_header_table_size: 4096, settings_enable_push: 1, settings_max_concurrent_streams: 100, settings_initial_window_size: 65_535, settings_max_frame_size: 16_384, settings_max_header_list_size: MAX_HEADER_LIST_SIZE, huffman: :shorter, index: :all, table_size: 4096) ⇒ Settings
constructor
A new instance of Settings.
Constructor Details
#initialize(settings_header_table_size: 4096, settings_enable_push: 1, settings_max_concurrent_streams: 100, settings_initial_window_size: 65_535, settings_max_frame_size: 16_384, settings_max_header_list_size: MAX_HEADER_LIST_SIZE, huffman: :shorter, index: :all, table_size: 4096) ⇒ Settings
Returns a new instance of Settings.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/http/2/settings.rb', line 32 def initialize( # connection settings settings_header_table_size: 4096, settings_enable_push: 1, settings_max_concurrent_streams: 100, settings_initial_window_size: 65_535, settings_max_frame_size: 16_384, settings_max_header_list_size: MAX_HEADER_LIST_SIZE, # encoding context settings huffman: :shorter, index: :all, table_size: 4096 ) super end |
Instance Attribute Details
#huffman ⇒ huffman_type
controls how to use huffman encoding to encode strings. can be one of the following values:
:always- Always use Huffman encoding:never- Do not use Huffman encoding:shorter- Use Huffman when the result is strictly shorter
41 42 43 |
# File 'sig/settings.rbs', line 41 def huffman @huffman end |
#index ⇒ index_type
controls the configuration of the HPACK indexing tables:
:static- use the static table only:all- use the static table and the dynamic table:never- do not use any of the tables.
48 49 50 |
# File 'sig/settings.rbs', line 48 def index @index end |
#settings_enable_push ⇒ Integer
can be used to disable server push (set to 0)
22 23 24 |
# File 'sig/settings.rbs', line 22 def settings_enable_push @settings_enable_push end |
#settings_header_table_size ⇒ Integer
maximum size of the header compression table used to decode header blocks, in bytes.
19 20 21 |
# File 'sig/settings.rbs', line 19 def settings_header_table_size @settings_header_table_size end |
#settings_initial_window_size ⇒ Integer
initial window size (in bytes) for stream-level flow control.
28 29 30 |
# File 'sig/settings.rbs', line 28 def settings_initial_window_size @settings_initial_window_size end |
#settings_max_concurrent_streams ⇒ Integer
maximum number of concurrent streams that the sender will allow.
25 26 27 |
# File 'sig/settings.rbs', line 25 def settings_max_concurrent_streams @settings_max_concurrent_streams end |
#settings_max_frame_size ⇒ Integer
max size of for payload that the sender is willing to receive, in bytes.
31 32 33 |
# File 'sig/settings.rbs', line 31 def settings_max_frame_size @settings_max_frame_size end |
#settings_max_header_list_size ⇒ Object
Returns the value of attribute settings_max_header_list_size
18 19 20 |
# File 'lib/http/2/settings.rb', line 18 def settings_max_header_list_size @settings_max_header_list_size end |
#table_size ⇒ Integer
maximum dynamic table size in bytes
51 52 53 |
# File 'sig/settings.rbs', line 51 def table_size @table_size end |
Instance Method Details
#connection_settings ⇒ self #connection_settings ⇒ Enumerable[[Symbol, Integer]]
yields connection-level settings only.
68 69 70 71 72 73 74 75 76 |
# File 'sig/settings.rbs', line 68 def connection_settings return enum_for(__method__) unless block_given? each_pair do |k, v| next if ENCODING_CONTEXT_SETTINGS.include?(k) yield k, v end end |