Class: HTTP::Protocol::HTTP2::PendingSettings
- Inherits:
-
Object
- Object
- HTTP::Protocol::HTTP2::PendingSettings
- Defined in:
- lib/http/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.
144 145 146 147 148 149 |
# File 'lib/http/protocol/http2/settings_frame.rb', line 144 def initialize(current = Settings.new) @current = current @pending = current.dup @queue = [] end |
Instance Attribute Details
#current ⇒ Object (readonly)
Returns the value of attribute current.
151 152 153 |
# File 'lib/http/protocol/http2/settings_frame.rb', line 151 def current @current end |
#pending ⇒ Object (readonly)
Returns the value of attribute pending.
152 153 154 |
# File 'lib/http/protocol/http2/settings_frame.rb', line 152 def pending @pending end |
Instance Method Details
#acknowledge ⇒ Object
159 160 161 162 163 164 165 166 167 |
# File 'lib/http/protocol/http2/settings_frame.rb', line 159 def acknowledge if changes = @queue.shift @current.update(changes) return changes else raise ProtocolError.new("Cannot acknowledge settings, no changes pending") end end |
#append(changes) ⇒ Object
154 155 156 157 |
# File 'lib/http/protocol/http2/settings_frame.rb', line 154 def append(changes) @queue << changes @pending.update(changes) end |
#enable_push ⇒ Object
173 174 175 |
# File 'lib/http/protocol/http2/settings_frame.rb', line 173 def enable_push @current.enable_push end |
#header_table_size ⇒ Object
169 170 171 |
# File 'lib/http/protocol/http2/settings_frame.rb', line 169 def header_table_size @current.header_table_size end |
#initial_window_size ⇒ Object
181 182 183 |
# File 'lib/http/protocol/http2/settings_frame.rb', line 181 def initial_window_size @current.initial_window_size end |
#maximum_concurrent_streams ⇒ Object
177 178 179 |
# File 'lib/http/protocol/http2/settings_frame.rb', line 177 def maximum_concurrent_streams @current.maximum_concurrent_streams end |
#maximum_frame_size ⇒ Object
185 186 187 |
# File 'lib/http/protocol/http2/settings_frame.rb', line 185 def maximum_frame_size @current.maximum_frame_size end |
#maximum_header_list_size ⇒ Object
189 190 191 |
# File 'lib/http/protocol/http2/settings_frame.rb', line 189 def maximum_header_list_size @current.maximum_header_list_size end |