Class: Protocol::HTTP2::PendingSettings
- Inherits:
-
Object
- Object
- Protocol::HTTP2::PendingSettings
- Defined in:
- lib/protocol/http2/settings_frame.rb
Overview
Manages pending settings changes that haven’t been acknowledged yet.
Instance Attribute Summary collapse
-
#current ⇒ Object
readonly
Returns the value of attribute current.
-
#pending ⇒ Object
readonly
Returns the value of attribute pending.
Instance Method Summary collapse
-
#acknowledge ⇒ Object
Acknowledge the next set of pending changes.
-
#append(changes) ⇒ Object
Append changes to the pending queue.
-
#enable_connect_protocol ⇒ Object
Get the current CONNECT protocol enable setting.
-
#enable_push ⇒ Object
Get the current enable push setting.
-
#header_table_size ⇒ Object
Get the current header table size setting.
-
#initial_window_size ⇒ Object
Get the current initial window size setting.
-
#initialize(current = Settings.new) ⇒ PendingSettings
constructor
Initialize with current settings.
-
#maximum_concurrent_streams ⇒ Object
Get the current maximum concurrent streams setting.
-
#maximum_frame_size ⇒ Object
Get the current maximum frame size setting.
-
#maximum_header_list_size ⇒ Object
Get the current maximum header list size setting.
Constructor Details
#initialize(current = Settings.new) ⇒ PendingSettings
Initialize with current settings.
160 161 162 163 164 165 |
# File 'lib/protocol/http2/settings_frame.rb', line 160 def initialize(current = Settings.new) @current = current @pending = current.dup @queue = [] end |
Instance Attribute Details
#current ⇒ Object (readonly)
Returns the value of attribute current.
167 168 169 |
# File 'lib/protocol/http2/settings_frame.rb', line 167 def current @current end |
#pending ⇒ Object (readonly)
Returns the value of attribute pending.
168 169 170 |
# File 'lib/protocol/http2/settings_frame.rb', line 168 def pending @pending end |
Instance Method Details
#acknowledge ⇒ Object
Acknowledge the next set of pending changes.
178 179 180 181 182 183 184 185 186 |
# File 'lib/protocol/http2/settings_frame.rb', line 178 def acknowledge if changes = @queue.shift @current.update(changes) return changes else raise ProtocolError, "Cannot acknowledge settings, no changes pending" end end |
#append(changes) ⇒ Object
Append changes to the pending queue.
172 173 174 175 |
# File 'lib/protocol/http2/settings_frame.rb', line 172 def append(changes) @queue << changes @pending.update(changes) end |
#enable_connect_protocol ⇒ Object
Get the current CONNECT protocol enable setting.
226 227 228 |
# File 'lib/protocol/http2/settings_frame.rb', line 226 def enable_connect_protocol @current.enable_connect_protocol end |
#enable_push ⇒ Object
Get the current enable push setting.
196 197 198 |
# File 'lib/protocol/http2/settings_frame.rb', line 196 def enable_push @current.enable_push end |
#header_table_size ⇒ Object
Get the current header table size setting.
190 191 192 |
# File 'lib/protocol/http2/settings_frame.rb', line 190 def header_table_size @current.header_table_size end |
#initial_window_size ⇒ Object
Get the current initial window size setting.
208 209 210 |
# File 'lib/protocol/http2/settings_frame.rb', line 208 def initial_window_size @current.initial_window_size end |
#maximum_concurrent_streams ⇒ Object
Get the current maximum concurrent streams setting.
202 203 204 |
# File 'lib/protocol/http2/settings_frame.rb', line 202 def maximum_concurrent_streams @current.maximum_concurrent_streams end |
#maximum_frame_size ⇒ Object
Get the current maximum frame size setting.
214 215 216 |
# File 'lib/protocol/http2/settings_frame.rb', line 214 def maximum_frame_size @current.maximum_frame_size end |
#maximum_header_list_size ⇒ Object
Get the current maximum header list size setting.
220 221 222 |
# File 'lib/protocol/http2/settings_frame.rb', line 220 def maximum_header_list_size @current.maximum_header_list_size end |