Module: HTTPX::Plugins::StreamBidi::ConnectionMethods
- Defined in:
- lib/httpx/plugins/stream_bidi.rb
Overview
overrides the declaration of @write_buffer, which is now a thread-safe buffer responding to the same API.
Instance Attribute Summary collapse
-
#signal ⇒ Object
writeonly
Sets the attribute signal.
Instance Method Summary collapse
- #call ⇒ Object
- #initialize ⇒ Object
-
#interests ⇒ Object
rebuffers the @write_buffer before calculating interests.
Instance Attribute Details
#signal=(value) ⇒ Object (writeonly)
Sets the attribute signal
341 342 343 |
# File 'lib/httpx/plugins/stream_bidi.rb', line 341 def signal=(value) @signal = value end |
Instance Method Details
#call ⇒ Object
360 361 362 363 364 |
# File 'lib/httpx/plugins/stream_bidi.rb', line 360 def call return super unless .stream && (error = @signal.error) on_error(error) end |
#initialize ⇒ Object
343 344 345 346 347 348 349 |
# File 'lib/httpx/plugins/stream_bidi.rb', line 343 def initialize(*) super return unless .stream @write_buffer = BidiBuffer.new(.buffer_size) end |
#interests ⇒ Object
rebuffers the @write_buffer before calculating interests.
352 353 354 355 356 357 358 |
# File 'lib/httpx/plugins/stream_bidi.rb', line 352 def interests return super unless .stream @write_buffer.rebuffer super end |