Module: HTTPX::Plugins::FiberConcurrency::HTTP2Methods

Defined in:
lib/httpx/plugins/fiber_concurrency.rb

Instance Method Summary collapse

Instance Method Details

#initializeObject



99
100
101
102
# File 'lib/httpx/plugins/fiber_concurrency.rb', line 99

def initialize(*)
  super
  @contexts = Hash.new { |hs, k| hs[k] = Set.new }
end

#interestsObject



104
105
106
107
108
109
110
111
112
# File 'lib/httpx/plugins/fiber_concurrency.rb', line 104

def interests
  if @connection.state == :connected && @handshake_completed && !@contexts.key?(Fiber.current)
    return :w unless @pings.empty?

    return
  end

  super
end

#send(request) ⇒ Object



114
115
116
117
118
# File 'lib/httpx/plugins/fiber_concurrency.rb', line 114

def send(request, *)
  add_to_context(request)

  super
end