Class: LangGraphRB::ResultCollector

Inherits:
Object
  • Object
show all
Defined in:
lib/langgraph_rb/runner.rb

Overview

Thread-safe execution result collector

Instance Method Summary collapse

Constructor Details

#initializeResultCollector



444
445
446
447
# File 'lib/langgraph_rb/runner.rb', line 444

def initialize
  @results = []
  @mutex = Mutex.new
end

Instance Method Details

#add(result) ⇒ Object



449
450
451
452
453
# File 'lib/langgraph_rb/runner.rb', line 449

def add(result)
  @mutex.synchronize do
    @results << result
  end
end

#allObject



455
456
457
458
459
# File 'lib/langgraph_rb/runner.rb', line 455

def all
  @mutex.synchronize do
    @results.dup
  end
end

#clearObject



461
462
463
464
465
# File 'lib/langgraph_rb/runner.rb', line 461

def clear
  @mutex.synchronize do
    @results.clear
  end
end