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.
141 142 143 144 145 146 |
# File 'lib/protocol/http2/settings_frame.rb', line 141 def initialize(current = Settings.new) @current = current @pending = current.dup @queue = [] end |
Instance Attribute Details
#current ⇒ Object (readonly)
Returns the value of attribute current.
148 149 150 |
# File 'lib/protocol/http2/settings_frame.rb', line 148 def current @current end |
#pending ⇒ Object (readonly)
Returns the value of attribute pending.
149 150 151 |
# File 'lib/protocol/http2/settings_frame.rb', line 149 def pending @pending end |
Instance Method Details
#acknowledge ⇒ Object
156 157 158 159 160 161 162 163 164 |
# File 'lib/protocol/http2/settings_frame.rb', line 156 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
151 152 153 154 |
# File 'lib/protocol/http2/settings_frame.rb', line 151 def append(changes) @queue << changes @pending.update(changes) end |
#enable_push ⇒ Object
170 171 172 |
# File 'lib/protocol/http2/settings_frame.rb', line 170 def enable_push @current.enable_push end |
#header_table_size ⇒ Object
166 167 168 |
# File 'lib/protocol/http2/settings_frame.rb', line 166 def header_table_size @current.header_table_size end |
#initial_window_size ⇒ Object
178 179 180 |
# File 'lib/protocol/http2/settings_frame.rb', line 178 def initial_window_size @current.initial_window_size end |
#maximum_concurrent_streams ⇒ Object
174 175 176 |
# File 'lib/protocol/http2/settings_frame.rb', line 174 def maximum_concurrent_streams @current.maximum_concurrent_streams end |
#maximum_frame_size ⇒ Object
182 183 184 |
# File 'lib/protocol/http2/settings_frame.rb', line 182 def maximum_frame_size @current.maximum_frame_size end |
#maximum_header_list_size ⇒ Object
186 187 188 |
# File 'lib/protocol/http2/settings_frame.rb', line 186 def maximum_header_list_size @current.maximum_header_list_size end |