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: MAX_HEADER_TABLE_SIZE, 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: MAX_HEADER_TABLE_SIZE) ⇒ Settings
constructor
A new instance of Settings.
Constructor Details
#initialize(settings_header_table_size: MAX_HEADER_TABLE_SIZE, 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: MAX_HEADER_TABLE_SIZE) ⇒ Settings
Returns a new instance of Settings.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/http/2/settings.rb', line 33 def initialize( # connection settings settings_header_table_size: MAX_HEADER_TABLE_SIZE, 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: MAX_HEADER_TABLE_SIZE ) 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
43 44 45 |
# File 'sig/settings.rbs', line 43 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.
50 51 52 |
# File 'sig/settings.rbs', line 50 def index @index end |
#settings_enable_push ⇒ Integer
can be used to disable server push (set to 0)
24 25 26 |
# File 'sig/settings.rbs', line 24 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.
21 22 23 |
# File 'sig/settings.rbs', line 21 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.
30 31 32 |
# File 'sig/settings.rbs', line 30 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.
27 28 29 |
# File 'sig/settings.rbs', line 27 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.
33 34 35 |
# File 'sig/settings.rbs', line 33 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
19 20 21 |
# File 'lib/http/2/settings.rb', line 19 def settings_max_header_list_size @settings_max_header_list_size end |
#table_size ⇒ Integer
maximum dynamic table size in bytes
53 54 55 |
# File 'sig/settings.rbs', line 53 def table_size @table_size end |
Instance Method Details
#connection_settings ⇒ self #connection_settings ⇒ Enumerable[[Symbol, Integer]]
yields connection-level settings only.
70 71 72 73 74 75 76 77 78 |
# File 'sig/settings.rbs', line 70 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 |