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.
22 23 24 25 |
# File 'lib/llm/function/task.rb', line 22 def initialize(fn, = {}) @function = fn @guarded = [:guarded] 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.
37 38 39 |
# File 'lib/llm/function/task.rb', line 37 def alive? raise NotImplementedError end |
#group_class ⇒ Class
This method is abstract.
60 61 62 |
# File 'lib/llm/function/task.rb', line 60 def group_class raise NotImplementedError end |
#interrupt! ⇒ nil Also known as: cancel!
This method is abstract.
44 45 46 |
# File 'lib/llm/function/task.rb', line 44 def interrupt! raise NotImplementedError end |
#spawn ⇒ nil
This method is abstract.
30 31 32 |
# File 'lib/llm/function/task.rb', line 30 def spawn raise NotImplementedError end |
#wait ⇒ LLM::Function::Return Also known as: value
This method is abstract.
52 53 54 |
# File 'lib/llm/function/task.rb', line 52 def wait raise NotImplementedError end |