Class: Biryani::StreamContext
- Inherits:
-
Object
- Object
- Biryani::StreamContext
- Defined in:
- lib/biryani/streams_context.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#fragment ⇒ Object
Returns the value of attribute fragment.
-
#recv_window ⇒ Object
Returns the value of attribute recv_window.
-
#send_window ⇒ Object
Returns the value of attribute send_window.
Instance Method Summary collapse
- #<<(req) ⇒ Object
- #active? ⇒ Boolean
- #close ⇒ Object
- #closed? ⇒ Boolean
- #half_closed_remote? ⇒ Boolean
- #idle? ⇒ Boolean
-
#initialize(stream_id, send_initial_window_size, recv_initial_window_size, proc, tx) ⇒ StreamContext
constructor
A new instance of StreamContext.
- #receiving_continuation? ⇒ Boolean
- #state_transition!(frame, direction) ⇒ Object
Constructor Details
#initialize(stream_id, send_initial_window_size, recv_initial_window_size, proc, tx) ⇒ StreamContext
Returns a new instance of StreamContext.
111 112 113 114 115 116 117 118 |
# File 'lib/biryani/streams_context.rb', line 111 def initialize(stream_id, send_initial_window_size, recv_initial_window_size, proc, tx) @stream = Stream.new(tx, stream_id, proc) @send_window = Window.new(send_initial_window_size) @recv_window = Window.new(recv_initial_window_size) @fragment = ''.b @content = ''.b @state = State.new end |
Instance Attribute Details
#content ⇒ Object
Returns the value of attribute content.
104 105 106 |
# File 'lib/biryani/streams_context.rb', line 104 def content @content end |
#fragment ⇒ Object
Returns the value of attribute fragment.
104 105 106 |
# File 'lib/biryani/streams_context.rb', line 104 def fragment @fragment end |
#recv_window ⇒ Object
Returns the value of attribute recv_window.
104 105 106 |
# File 'lib/biryani/streams_context.rb', line 104 def recv_window @recv_window end |
#send_window ⇒ Object
Returns the value of attribute send_window.
104 105 106 |
# File 'lib/biryani/streams_context.rb', line 104 def send_window @send_window end |
Instance Method Details
#<<(req) ⇒ Object
121 122 123 |
# File 'lib/biryani/streams_context.rb', line 121 def <<(req) @stream.rx.send(req, move: true) end |
#active? ⇒ Boolean
146 147 148 |
# File 'lib/biryani/streams_context.rb', line 146 def active? @state.active? end |
#close ⇒ Object
125 126 127 |
# File 'lib/biryani/streams_context.rb', line 125 def close @state.close end |
#closed? ⇒ Boolean
136 137 138 |
# File 'lib/biryani/streams_context.rb', line 136 def closed? @state.closed? end |
#half_closed_remote? ⇒ Boolean
151 152 153 |
# File 'lib/biryani/streams_context.rb', line 151 def half_closed_remote? @state.half_closed_remote? end |
#idle? ⇒ Boolean
141 142 143 |
# File 'lib/biryani/streams_context.rb', line 141 def idle? @state.idle? end |
#receiving_continuation? ⇒ Boolean
156 157 158 |
# File 'lib/biryani/streams_context.rb', line 156 def receiving_continuation? @state.receiving_continuation? end |
#state_transition!(frame, direction) ⇒ Object
131 132 133 |
# File 'lib/biryani/streams_context.rb', line 131 def state_transition!(frame, direction) @state.transition!(frame, direction) end |