Class: RubyLLM::MCP::Native::Transport
- Inherits:
-
Object
- Object
- RubyLLM::MCP::Native::Transport
- Extended by:
- Forwardable
- Defined in:
- lib/ruby_llm/mcp/native/transport.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#coordinator ⇒ Object
readonly
Returns the value of attribute coordinator.
-
#pid ⇒ Object
readonly
Returns the value of attribute pid.
-
#transport_type ⇒ Object
readonly
Returns the value of attribute transport_type.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(transport_type, coordinator, config:) ⇒ Transport
constructor
A new instance of Transport.
- #transport_protocol ⇒ Object
Constructor Details
#initialize(transport_type, coordinator, config:) ⇒ Transport
Returns a new instance of Transport.
26 27 28 29 30 31 |
# File 'lib/ruby_llm/mcp/native/transport.rb', line 26 def initialize(transport_type, coordinator, config:) @transport_type = transport_type @coordinator = coordinator @config = config @pid = Process.pid end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
24 25 26 |
# File 'lib/ruby_llm/mcp/native/transport.rb', line 24 def config @config end |
#coordinator ⇒ Object (readonly)
Returns the value of attribute coordinator.
24 25 26 |
# File 'lib/ruby_llm/mcp/native/transport.rb', line 24 def coordinator @coordinator end |
#pid ⇒ Object (readonly)
Returns the value of attribute pid.
24 25 26 |
# File 'lib/ruby_llm/mcp/native/transport.rb', line 24 def pid @pid end |
#transport_type ⇒ Object (readonly)
Returns the value of attribute transport_type.
24 25 26 |
# File 'lib/ruby_llm/mcp/native/transport.rb', line 24 def transport_type @transport_type end |
Class Method Details
.register_transport(transport_type, transport_class) ⇒ Object
12 13 14 |
# File 'lib/ruby_llm/mcp/native/transport.rb', line 12 def register_transport(transport_type, transport_class) transports[transport_type] = transport_class end |
.transports ⇒ Object
8 9 10 |
# File 'lib/ruby_llm/mcp/native/transport.rb', line 8 def transports @transports ||= {} end |
Instance Method Details
#transport_protocol ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/ruby_llm/mcp/native/transport.rb', line 35 def transport_protocol if @pid != Process.pid @pid = Process.pid @transport_protocol = nil @transport_protocol = build_transport end @transport_protocol ||= build_transport end |