Class: Protocol::HTTP2::Priority
- Inherits:
-
Struct
- Object
- Struct
- Protocol::HTTP2::Priority
- Defined in:
- lib/protocol/http2/priority_frame.rb
Overview
Stream Dependency: A 31-bit stream identifier for the stream that this stream depends on (see Section 5.3). This field is only present if the PRIORITY flag is set.
Constant Summary collapse
- FORMAT =
"NC".freeze
- EXCLUSIVE =
1 << 31
Instance Attribute Summary collapse
-
#exclusive ⇒ Object
Returns the value of attribute exclusive.
-
#stream_dependency ⇒ Object
Returns the value of attribute stream_dependency.
-
#weight ⇒ Object
Returns the value of attribute weight.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#exclusive ⇒ Object
Returns the value of attribute exclusive
28 29 30 |
# File 'lib/protocol/http2/priority_frame.rb', line 28 def exclusive @exclusive end |
#stream_dependency ⇒ Object
Returns the value of attribute stream_dependency
28 29 30 |
# File 'lib/protocol/http2/priority_frame.rb', line 28 def stream_dependency @stream_dependency end |
#weight ⇒ Object
Returns the value of attribute weight
28 29 30 |
# File 'lib/protocol/http2/priority_frame.rb', line 28 def weight @weight end |
Class Method Details
.unpack(data) ⇒ Object
32 33 34 35 36 |
# File 'lib/protocol/http2/priority_frame.rb', line 32 def self.unpack(data) stream_dependency, weight = data.unpack(FORMAT) return self.new(stream_dependency & EXCLUSIVE != 0, stream_dependency & ~EXCLUSIVE, weight) end |
Instance Method Details
#pack ⇒ Object
38 39 40 41 42 43 44 |
# File 'lib/protocol/http2/priority_frame.rb', line 38 def pack if exclusive stream_dependency = self.stream_dependency | EXCLUSIVE end return [stream_dependency, self.weight].pack(FORMAT) end |