Class: Protocol::HTTP2::PendingSettings

Inherits:
Object
  • Object
show all
Defined in:
lib/protocol/http2/settings_frame.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(current = Settings.new) ⇒ PendingSettings

Returns a new instance of PendingSettings.



149
150
151
152
153
154
# File 'lib/protocol/http2/settings_frame.rb', line 149

def initialize(current = Settings.new)
  @current = current
  @pending = current.dup
  
  @queue = []
end

Instance Attribute Details

#currentObject (readonly)

Returns the value of attribute current.



156
157
158
# File 'lib/protocol/http2/settings_frame.rb', line 156

def current
  @current
end

#pendingObject (readonly)

Returns the value of attribute pending.



157
158
159
# File 'lib/protocol/http2/settings_frame.rb', line 157

def pending
  @pending
end

Instance Method Details

#acknowledgeObject



164
165
166
167
168
169
170
171
172
# File 'lib/protocol/http2/settings_frame.rb', line 164

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



159
160
161
162
# File 'lib/protocol/http2/settings_frame.rb', line 159

def append(changes)
  @queue << changes
  @pending.update(changes)
end

#enable_connect_protocolObject



198
199
200
# File 'lib/protocol/http2/settings_frame.rb', line 198

def enable_connect_protocol
  @current.enable_connect_protocol
end

#enable_pushObject



178
179
180
# File 'lib/protocol/http2/settings_frame.rb', line 178

def enable_push
  @current.enable_push
end

#header_table_sizeObject



174
175
176
# File 'lib/protocol/http2/settings_frame.rb', line 174

def header_table_size
  @current.header_table_size
end

#initial_window_sizeObject



186
187
188
# File 'lib/protocol/http2/settings_frame.rb', line 186

def initial_window_size
  @current.initial_window_size
end

#maximum_concurrent_streamsObject



182
183
184
# File 'lib/protocol/http2/settings_frame.rb', line 182

def maximum_concurrent_streams
  @current.maximum_concurrent_streams
end

#maximum_frame_sizeObject



190
191
192
# File 'lib/protocol/http2/settings_frame.rb', line 190

def maximum_frame_size
  @current.maximum_frame_size
end

#maximum_header_list_sizeObject



194
195
196
# File 'lib/protocol/http2/settings_frame.rb', line 194

def maximum_header_list_size
  @current.maximum_header_list_size
end