Class: LLM::Function::CallGroup
- Inherits:
-
Object
- Object
- LLM::Function::CallGroup
- Defined in:
- lib/llm/function/call_group.rb
Overview
The CallGroup class wraps an array of LLM::Function objects for sequential execution.
It provides the same basic interface as the concurrent group
wrappers so callers can flow through spawn(strategy).wait
uniformly, even when the selected strategy is direct calls.
Instance Method Summary collapse
- #alive? ⇒ Boolean
- #initialize(functions) ⇒ LLM::Function::CallGroup constructor
- #interrupt! ⇒ nil (also: #cancel!)
- #wait ⇒ Array<LLM::Function::Return> (also: #value)
Constructor Details
#initialize(functions) ⇒ LLM::Function::CallGroup
15 16 17 18 |
# File 'lib/llm/function/call_group.rb', line 15 def initialize(functions) @functions = functions @owner = nil end |
Instance Method Details
#alive? ⇒ Boolean
22 23 24 |
# File 'lib/llm/function/call_group.rb', line 22 def alive? false end |
#interrupt! ⇒ nil Also known as: cancel!
28 29 30 31 |
# File 'lib/llm/function/call_group.rb', line 28 def interrupt! @owner&.raise(LLM::Interrupt) nil end |
#wait ⇒ Array<LLM::Function::Return> Also known as: value
36 37 38 39 40 41 |
# File 'lib/llm/function/call_group.rb', line 36 def wait @owner = Thread.current @functions.map(&:call) ensure @owner = nil end |