Class: LLM::Function::Fork::Group
- Inherits:
-
Object
- Object
- LLM::Function::Fork::Group
- Defined in:
- lib/llm/function/fork_group.rb
Overview
Instance Method Summary collapse
- #alive? ⇒ Boolean
- #initialize(tasks) ⇒ LLM::Function::Fork::Group constructor
- #interrupt! ⇒ nil (also: #cancel!)
- #wait ⇒ Array<LLM::Function::Return> (also: #value)
Constructor Details
#initialize(tasks) ⇒ LLM::Function::Fork::Group
11 12 13 |
# File 'lib/llm/function/fork_group.rb', line 11 def initialize(tasks) @tasks = tasks end |
Instance Method Details
#alive? ⇒ Boolean
17 18 19 |
# File 'lib/llm/function/fork_group.rb', line 17 def alive? @tasks.any?(&:alive?) end |
#interrupt! ⇒ nil Also known as: cancel!
23 24 25 26 |
# File 'lib/llm/function/fork_group.rb', line 23 def interrupt! @tasks.each(&:interrupt!) nil end |
#wait ⇒ Array<LLM::Function::Return> Also known as: value
31 32 33 |
# File 'lib/llm/function/fork_group.rb', line 31 def wait @tasks.map(&:wait) end |