Class: LLM::Function::Sequential::Group

Inherits:
Group
  • Object
show all
Defined in:
lib/llm/function/sequential/group.rb

Overview

Wraps an array of LLM::Function objects for sequential execution. Provides the same interface as concurrent group wrappers so callers can flow through spawn(strategy).wait uniformly.

Instance Method Summary collapse

Constructor Details

#initialize(functions) ⇒ Group

Returns a new instance of Group.

Parameters:



12
13
14
15
# File 'lib/llm/function/sequential/group.rb', line 12

def initialize(functions)
  @functions = functions
  @owner = nil
end

Instance Method Details

#alive?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/llm/function/sequential/group.rb', line 26

def alive?
  false
end

#interrupt!nil Also known as: cancel!

Returns:

  • (nil)


32
33
34
35
# File 'lib/llm/function/sequential/group.rb', line 32

def interrupt!
  @owner&.raise(LLM::Interrupt)
  nil
end

#spawnnil

Returns:

  • (nil)


19
20
21
22
# File 'lib/llm/function/sequential/group.rb', line 19

def spawn
  # no-op — execution happens in wait
  nil
end

#waitArray<LLM::Function::Return> Also known as: value



40
41
42
43
44
45
# File 'lib/llm/function/sequential/group.rb', line 40

def wait
  @owner = Thread.current
  @functions.map(&:call)
ensure
  @owner = nil
end