Class: LangGraphRB::ResultCollector
- Inherits:
-
Object
- Object
- LangGraphRB::ResultCollector
- Defined in:
- lib/langgraph_rb/runner.rb
Overview
Thread-safe execution result collector
Instance Method Summary collapse
- #add(result) ⇒ Object
- #all ⇒ Object
- #clear ⇒ Object
-
#initialize ⇒ ResultCollector
constructor
A new instance of ResultCollector.
Constructor Details
#initialize ⇒ ResultCollector
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 |
#all ⇒ Object
455 456 457 458 459 |
# File 'lib/langgraph_rb/runner.rb', line 455 def all @mutex.synchronize do @results.dup end end |
#clear ⇒ Object
461 462 463 464 465 |
# File 'lib/langgraph_rb/runner.rb', line 461 def clear @mutex.synchronize do @results.clear end end |