class HTTPX::Plugins::StreamBidi::Signal

  1. lib/httpx/plugins/stream_bidi.rb
Superclass: Object

Functions as a way to wake up the session main loop when one of the connections has buffered data to write. It abides by the Selectable API, which allows it to be registered in the selector alongside actual HTTP-based Connection objects.

Methods

Public Class

  1. new

Public Instance

  1. call
  2. interests
  3. state
  4. terminate
  5. timeout
  6. to_io
  7. wakeup

Public Class methods

new()
[show source]
    # File lib/httpx/plugins/stream_bidi.rb
118 def initialize
119   @pipe_read, @pipe_write = ::IO.pipe
120 end

Public Instance methods

call()
[show source]
    # File lib/httpx/plugins/stream_bidi.rb
132 def call
133   @pipe_read.readpartial(1)
134 end
interests()
[show source]
    # File lib/httpx/plugins/stream_bidi.rb
136 def interests
137   :r
138 end
state()
[show source]
    # File lib/httpx/plugins/stream_bidi.rb
122 def state; end
terminate()
[show source]
    # File lib/httpx/plugins/stream_bidi.rb
142 def terminate
143   @pipe_write.close
144   @pipe_read.close
145 end
timeout()
[show source]
    # File lib/httpx/plugins/stream_bidi.rb
140 def timeout; end
to_io()
[show source]
    # File lib/httpx/plugins/stream_bidi.rb
124 def to_io
125   @pipe_read.to_io
126 end
wakeup()
[show source]
    # File lib/httpx/plugins/stream_bidi.rb
128 def wakeup
129   @pipe_write.write("\0")
130 end