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.



140
141
142
143
144
145
# File 'lib/protocol/http2/settings_frame.rb', line 140

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

Instance Attribute Details

#currentObject (readonly)

Returns the value of attribute current.



147
148
149
# File 'lib/protocol/http2/settings_frame.rb', line 147

def current
  @current
end

#pendingObject (readonly)

Returns the value of attribute pending.



148
149
150
# File 'lib/protocol/http2/settings_frame.rb', line 148

def pending
  @pending
end

Instance Method Details

#acknowledgeObject



155
156
157
158
159
160
161
162
163
# File 'lib/protocol/http2/settings_frame.rb', line 155

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



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

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

#enable_pushObject



169
170
171
# File 'lib/protocol/http2/settings_frame.rb', line 169

def enable_push
	@current.enable_push
end

#header_table_sizeObject



165
166
167
# File 'lib/protocol/http2/settings_frame.rb', line 165

def header_table_size
	@current.header_table_size
end

#initial_window_sizeObject



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

def initial_window_size
	@current.initial_window_size
end

#maximum_concurrent_streamsObject



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

def maximum_concurrent_streams
	@current.maximum_concurrent_streams
end

#maximum_frame_sizeObject



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

def maximum_frame_size
	@current.maximum_frame_size
end

#maximum_header_list_sizeObject



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

def maximum_header_list_size
	@current.maximum_header_list_size
end