Class: Legion::Extensions::Llm::Inventory::DispatchLease
- Inherits:
-
Object
- Object
- Legion::Extensions::Llm::Inventory::DispatchLease
- Defined in:
- lib/legion/extensions/llm/inventory/callable_handle.rb
Overview
A dispatch lease over a CallableHandle. Holds the exact provider callable for one in-flight request and releases the reference exactly once. See phase-1-lex-llm-additive.md section 11.4.
Instance Attribute Summary collapse
-
#callable ⇒ Object
readonly
Returns the value of attribute callable.
-
#lease_id ⇒ Object
readonly
Returns the value of attribute lease_id.
Instance Method Summary collapse
-
#initialize(lease_id:, callable_handle:, callable:) ⇒ DispatchLease
constructor
A new instance of DispatchLease.
- #release ⇒ Object
- #released? ⇒ Boolean
Constructor Details
#initialize(lease_id:, callable_handle:, callable:) ⇒ DispatchLease
Returns a new instance of DispatchLease.
17 18 19 20 21 22 |
# File 'lib/legion/extensions/llm/inventory/callable_handle.rb', line 17 def initialize(lease_id:, callable_handle:, callable:) @lease_id = lease_id.dup.freeze @callable_handle = callable_handle @callable = callable @released = false end |
Instance Attribute Details
#callable ⇒ Object (readonly)
Returns the value of attribute callable.
15 16 17 |
# File 'lib/legion/extensions/llm/inventory/callable_handle.rb', line 15 def callable @callable end |
#lease_id ⇒ Object (readonly)
Returns the value of attribute lease_id.
15 16 17 |
# File 'lib/legion/extensions/llm/inventory/callable_handle.rb', line 15 def lease_id @lease_id end |
Instance Method Details
#release ⇒ Object
28 29 30 |
# File 'lib/legion/extensions/llm/inventory/callable_handle.rb', line 28 def release @callable_handle.__send__(:release_lease, self) end |
#released? ⇒ Boolean
24 25 26 |
# File 'lib/legion/extensions/llm/inventory/callable_handle.rb', line 24 def released? @released end |