Class: RubyLLM::MCP::Native::Transports::Support::HTTPClient

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_llm/mcp/native/transports/support/http_client.rb

Constant Summary collapse

CONNECTION_KEY =
:ruby_llm_mcp_client_connection

Class Method Summary collapse

Class Method Details

.build_connectionObject



15
16
17
18
19
20
21
22
# File 'lib/ruby_llm/mcp/native/transports/support/http_client.rb', line 15

def self.build_connection
  HTTPX.with(
    pool_options: {
      max_connections: RubyLLM::MCP.config.max_connections,
      pool_timeout: RubyLLM::MCP.config.pool_timeout
    }
  )
end

.connectionObject



11
12
13
# File 'lib/ruby_llm/mcp/native/transports/support/http_client.rb', line 11

def self.connection
  Thread.current[CONNECTION_KEY] ||= build_connection
end