Class: Protocol::HTTP2::PriorityUpdateFrame

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

Overview

The PRIORITY_UPDATE frame is used by clients to signal the initial priority of a response, or to reprioritize a response or push stream. It carries the stream ID of the response and the priority in ASCII text, using the same representation as the Priority header field value.

-————------------------------------------------------ |R| Prioritized Stream ID (31) | -—————————–------------------------------- | Priority Field Value (*) … ---------------------------------------------------------------

Constant Summary collapse

TYPE =
0x10
FORMAT =
"N".freeze

Constants inherited from Frame

Frame::HEADER_FORMAT, Frame::LENGTH_HISHIFT, Frame::LENGTH_LOMASK, Frame::STREAM_ID_MASK, Frame::VALID_LENGTH, Frame::VALID_STREAM_ID

Instance Attribute Summary

Attributes inherited from Frame

#flags, #length, #payload, #stream_id, #type

Instance Method Summary collapse

Methods inherited from Frame

#<=>, #clear_flags, #connection?, #flag_set?, #header, #initialize, #inspect, parse_header, #read, #read_header, #read_payload, #set_flags, #to_ary, #valid_type?, #write, #write_header, #write_payload

Constructor Details

This class inherits a constructor from Protocol::HTTP2::Frame

Instance Method Details

#apply(connection) ⇒ Object



36
37
38
# File 'lib/protocol/http2/priority_update_frame.rb', line 36

def apply(connection)
	connection.receive_priority_update(self)
end

#pack(prioritized_stream_id, data, **options) ⇒ Object



32
33
34
# File 'lib/protocol/http2/priority_update_frame.rb', line 32

def pack(prioritized_stream_id, data, **options)
	super([prioritized_stream_id].pack(FORMAT) + data, **options)
end

#unpackObject



24
25
26
27
28
29
30
# File 'lib/protocol/http2/priority_update_frame.rb', line 24

def unpack
	data = super
	
	prioritized_stream_id = data.unpack1(FORMAT)
	
	return prioritized_stream_id, data.byteslice(4, data.bytesize - 4)
end