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

Returns a new instance of ResultCollector.



440
441
442
443
# File 'lib/langgraph_rb/runner.rb', line 440

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

Instance Method Details

#add(result) ⇒ Object



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

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

#allObject



451
452
453
454
455
# File 'lib/langgraph_rb/runner.rb', line 451

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

#clearObject



457
458
459
460
461
# File 'lib/langgraph_rb/runner.rb', line 457

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