Class: LLM::Function::Sequential::Task

Inherits:
Task
  • Object
show all
Defined in:
lib/llm/function/sequential/task.rb

Overview

The Task class wraps a single direct function call behind the same task-like interface used by spawned concurrency modes.

Instance Attribute Summary

Attributes inherited from Task

#function

Instance Method Summary collapse

Methods inherited from Task

#initialize

Constructor Details

This class inherits a constructor from LLM::Function::Task

Instance Method Details

#alive?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/llm/function/sequential/task.rb', line 17

def alive?
  false
end

#group_classClass

Returns:

  • (Class)


38
39
40
# File 'lib/llm/function/sequential/task.rb', line 38

def group_class
  LLM::Function::Sequential::Group
end

#interrupt!nil Also known as: cancel!

Returns:

  • (nil)


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

def interrupt!
  function.interrupt!
  nil
end

#spawnnil

Returns:

  • (nil)


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

def spawn
  # no-op (execution happens in wait)
end

#waitLLM::Function::Return Also known as: value



31
32
33
# File 'lib/llm/function/sequential/task.rb', line 31

def wait
  @result ||= @guarded || function.call
end