Class: LLM::Function::Task
- Inherits:
-
Object
- Object
- LLM::Function::Task
- Defined in:
- lib/llm/function/task.rb
Overview
This class is the superclass that all concurrency strategies must subclass in order to implement their own Task class. It provides a common interface that is the same across all concurrency strategies.
Direct Known Subclasses
Async::Task, Fiber::Task, Fork::Task, Ractor::Task, Sequential::Task, LLM::Function::Thread::Task
Instance Attribute Summary collapse
- #function ⇒ LLM::Function readonly
Instance Method Summary collapse
- #alive? ⇒ Boolean abstract
- #group_class ⇒ Class abstract
-
#initialize(fn, options = {}) ⇒ Task
constructor
A new instance of Task.
- #interrupt! ⇒ nil (also: #cancel!) abstract
- #spawn ⇒ nil abstract
- #wait ⇒ LLM::Function::Return (also: #value) abstract
Constructor Details
#initialize(fn, options = {}) ⇒ Task
Returns a new instance of Task.
19 20 21 |
# File 'lib/llm/function/task.rb', line 19 def initialize(fn, = {}) @function = fn end |
Instance Attribute Details
#function ⇒ LLM::Function (readonly)
12 13 14 |
# File 'lib/llm/function/task.rb', line 12 def function @function end |
Instance Method Details
#alive? ⇒ Boolean
This method is abstract.
33 34 35 |
# File 'lib/llm/function/task.rb', line 33 def alive? raise NotImplementedError end |
#group_class ⇒ Class
This method is abstract.
56 57 58 |
# File 'lib/llm/function/task.rb', line 56 def group_class raise NotImplementedError end |
#interrupt! ⇒ nil Also known as: cancel!
This method is abstract.
40 41 42 |
# File 'lib/llm/function/task.rb', line 40 def interrupt! raise NotImplementedError end |
#spawn ⇒ nil
This method is abstract.
26 27 28 |
# File 'lib/llm/function/task.rb', line 26 def spawn raise NotImplementedError end |
#wait ⇒ LLM::Function::Return Also known as: value
This method is abstract.
48 49 50 |
# File 'lib/llm/function/task.rb', line 48 def wait raise NotImplementedError end |