Class: NetHttp2::Stream
- Inherits:
-
Object
- Object
- NetHttp2::Stream
- Defined in:
- lib/net-http2/stream.rb
Instance Method Summary collapse
- #async? ⇒ Boolean
- #async_call_with(request) ⇒ Object
- #call_with(request) ⇒ Object
- #completed? ⇒ Boolean
- #id ⇒ Object
-
#initialize(options = {}) ⇒ Stream
constructor
A new instance of Stream.
Constructor Details
#initialize(options = {}) ⇒ Stream
Returns a new instance of Stream.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/net-http2/stream.rb', line 5 def initialize(={}) @h2_stream = [:h2_stream] @headers = {} @data = '' @request = nil @async = false @completed = false @mutex = Mutex.new @cv = ConditionVariable.new listen_for_headers listen_for_data listen_for_close end |
Instance Method Details
#async? ⇒ Boolean
41 42 43 |
# File 'lib/net-http2/stream.rb', line 41 def async? @async end |
#async_call_with(request) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/net-http2/stream.rb', line 30 def async_call_with(request) @request = request @async = true send_request_data end |
#call_with(request) ⇒ Object
24 25 26 27 28 |
# File 'lib/net-http2/stream.rb', line 24 def call_with(request) @request = request send_request_data sync_respond end |
#completed? ⇒ Boolean
37 38 39 |
# File 'lib/net-http2/stream.rb', line 37 def completed? @completed end |
#id ⇒ Object
20 21 22 |
# File 'lib/net-http2/stream.rb', line 20 def id @h2_stream.id end |