Class: SolidLoop::Mcp::StdioTransport::Diagnostics
- Inherits:
-
Object
- Object
- SolidLoop::Mcp::StdioTransport::Diagnostics
- Defined in:
- lib/solid_loop/mcp/stdio_transport.rb
Overview
Mutex-guarded string buffer: the stderr drain thread and the stdout reader append concurrently (safe under the GVL, undefined elsewhere).
Instance Method Summary collapse
- #<<(text) ⇒ Object
-
#initialize ⇒ Diagnostics
constructor
A new instance of Diagnostics.
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ Diagnostics
Returns a new instance of Diagnostics.
28 29 30 31 |
# File 'lib/solid_loop/mcp/stdio_transport.rb', line 28 def initialize @mutex = Mutex.new @buffer = +"" end |
Instance Method Details
#<<(text) ⇒ Object
33 34 35 36 |
# File 'lib/solid_loop/mcp/stdio_transport.rb', line 33 def <<(text) @mutex.synchronize { @buffer << text } self end |
#to_s ⇒ Object
38 39 40 |
# File 'lib/solid_loop/mcp/stdio_transport.rb', line 38 def to_s @mutex.synchronize { @buffer.dup } end |