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.
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
terminate()
[show source]
# File lib/httpx/plugins/stream_bidi.rb 142 def terminate 143 @pipe_write.close 144 @pipe_read.close 145 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