Class: Protocol::HTTP2::PendingSettings
- Inherits:
-
Object
- Object
- Protocol::HTTP2::PendingSettings
- Defined in:
- lib/protocol/http2/settings_frame.rb
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
- #append(changes) ⇒ Object
- #enable_push ⇒ Object
- #header_table_size ⇒ Object
- #initial_window_size ⇒ Object
-
#initialize(current = Settings.new) ⇒ PendingSettings
constructor
A new instance of PendingSettings.
- #maximum_concurrent_streams ⇒ Object
- #maximum_frame_size ⇒ Object
- #maximum_header_list_size ⇒ Object
Constructor Details
#initialize(current = Settings.new) ⇒ PendingSettings
Returns a new instance of PendingSettings.
165 166 167 168 169 170 |
# File 'lib/protocol/http2/settings_frame.rb', line 165 def initialize(current = Settings.new) @current = current @pending = current.dup @queue = [] end |
Instance Attribute Details
#current ⇒ Object (readonly)
Returns the value of attribute current.
172 173 174 |
# File 'lib/protocol/http2/settings_frame.rb', line 172 def current @current end |
#pending ⇒ Object (readonly)
Returns the value of attribute pending.
173 174 175 |
# File 'lib/protocol/http2/settings_frame.rb', line 173 def pending @pending end |
Instance Method Details
#acknowledge ⇒ Object
180 181 182 183 184 185 186 187 188 |
# File 'lib/protocol/http2/settings_frame.rb', line 180 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
175 176 177 178 |
# File 'lib/protocol/http2/settings_frame.rb', line 175 def append(changes) @queue << changes @pending.update(changes) end |
#enable_push ⇒ Object
194 195 196 |
# File 'lib/protocol/http2/settings_frame.rb', line 194 def enable_push @current.enable_push end |
#header_table_size ⇒ Object
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
202 203 204 |
# File 'lib/protocol/http2/settings_frame.rb', line 202 def initial_window_size @current.initial_window_size end |
#maximum_concurrent_streams ⇒ Object
198 199 200 |
# File 'lib/protocol/http2/settings_frame.rb', line 198 def maximum_concurrent_streams @current.maximum_concurrent_streams end |
#maximum_frame_size ⇒ Object
206 207 208 |
# File 'lib/protocol/http2/settings_frame.rb', line 206 def maximum_frame_size @current.maximum_frame_size end |
#maximum_header_list_size ⇒ Object
210 211 212 |
# File 'lib/protocol/http2/settings_frame.rb', line 210 def maximum_header_list_size @current.maximum_header_list_size end |