Module: HTTPX::Plugins::StreamBidi::InstanceMethods

Defined in:
lib/httpx/plugins/stream_bidi.rb,
sig/plugins/stream_bidi.rbs

Instance Method Summary collapse

Instance Method Details

#close(selector = Selector.new) ⇒ Object



237
238
239
240
241
# File 'lib/httpx/plugins/stream_bidi.rb', line 237

def close(selector = Selector.new)
  @signal.terminate
  selector.deregister(@signal)
  super
end

#deselect_connection(connection) ⇒ Object



251
252
253
254
255
256
257
# File 'lib/httpx/plugins/stream_bidi.rb', line 251

def deselect_connection(connection, *)
  return super unless connection.options.stream

  super

  connection.signal = nil
end

#initialize ⇒ Object



232
233
234
235
# File 'lib/httpx/plugins/stream_bidi.rb', line 232

def initialize(*)
  @signal = Signal.new
  super
end

#select_connection(connection, selector) ⇒ Object



243
244
245
246
247
248
249
# File 'lib/httpx/plugins/stream_bidi.rb', line 243

def select_connection(connection, selector)
  return super unless connection.options.stream

  super
  selector.register(@signal)
  connection.signal = @signal
end