Class: LLM::Function::Fork::Group

Inherits:
Object
  • Object
show all
Defined in:
lib/llm/function/fork_group.rb

Overview

The Group class wraps an array of Task objects that are running in forked child processes.

Instance Method Summary collapse

Constructor Details

#initialize(tasks) ⇒ LLM::Function::Fork::Group

Parameters:



11
12
13
# File 'lib/llm/function/fork_group.rb', line 11

def initialize(tasks)
  @tasks = tasks
end

Instance Method Details

#alive?Boolean

Returns:

  • (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!

Returns:

  • (nil)


23
24
25
26
# File 'lib/llm/function/fork_group.rb', line 23

def interrupt!
  @tasks.each(&:interrupt!)
  nil
end

#waitArray<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