Class: Quicsilver::Server::PendingStream
- Inherits:
-
Struct
- Object
- Struct
- Quicsilver::Server::PendingStream
- Defined in:
- lib/quicsilver/server/server.rb
Overview
Tracks an in-flight streaming request between RECEIVE and RECEIVE_FIN. The stream handle arrives at RECEIVE_FIN; the worker thread waits for it.
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#connection ⇒ Object
Returns the value of attribute connection.
-
#frame_buffer ⇒ Object
Returns the value of attribute frame_buffer.
-
#handle_ready ⇒ Object
Returns the value of attribute handle_ready.
-
#priority ⇒ Object
Returns the value of attribute priority.
-
#request ⇒ Object
Returns the value of attribute request.
-
#stream_handle ⇒ Object
Returns the value of attribute stream_handle.
-
#stream_id ⇒ Object
Returns the value of attribute stream_id.
Instance Method Summary collapse
-
#complete(handle) ⇒ Object
Called by RECEIVE_FIN handler to provide the stream handle.
-
#initialize ⇒ PendingStream
constructor
A new instance of PendingStream.
-
#wait_for_handle(timeout: 30) ⇒ Object
Called by worker thread to wait for the stream handle.
Constructor Details
#initialize ⇒ PendingStream
Returns a new instance of PendingStream.
21 22 23 24 25 |
# File 'lib/quicsilver/server/server.rb', line 21 def initialize(**) super self.handle_ready = Queue.new self.frame_buffer = "".b end |
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body
20 21 22 |
# File 'lib/quicsilver/server/server.rb', line 20 def body @body end |
#connection ⇒ Object
Returns the value of attribute connection
20 21 22 |
# File 'lib/quicsilver/server/server.rb', line 20 def connection @connection end |
#frame_buffer ⇒ Object
Returns the value of attribute frame_buffer
20 21 22 |
# File 'lib/quicsilver/server/server.rb', line 20 def frame_buffer @frame_buffer end |
#handle_ready ⇒ Object
Returns the value of attribute handle_ready
20 21 22 |
# File 'lib/quicsilver/server/server.rb', line 20 def handle_ready @handle_ready end |
#priority ⇒ Object
Returns the value of attribute priority
20 21 22 |
# File 'lib/quicsilver/server/server.rb', line 20 def priority @priority end |
#request ⇒ Object
Returns the value of attribute request
20 21 22 |
# File 'lib/quicsilver/server/server.rb', line 20 def request @request end |
#stream_handle ⇒ Object
Returns the value of attribute stream_handle
20 21 22 |
# File 'lib/quicsilver/server/server.rb', line 20 def stream_handle @stream_handle end |
#stream_id ⇒ Object
Returns the value of attribute stream_id
20 21 22 |
# File 'lib/quicsilver/server/server.rb', line 20 def stream_id @stream_id end |
Instance Method Details
#complete(handle) ⇒ Object
Called by RECEIVE_FIN handler to provide the stream handle
28 29 30 31 |
# File 'lib/quicsilver/server/server.rb', line 28 def complete(handle) self.stream_handle = handle handle_ready.push(true) end |
#wait_for_handle(timeout: 30) ⇒ Object
Called by worker thread to wait for the stream handle
34 35 36 37 |
# File 'lib/quicsilver/server/server.rb', line 34 def wait_for_handle(timeout: 30) handle_ready.pop(timeout: timeout) stream_handle end |