Class: Legion::Extensions::Llm::Inventory::Publisher
- Inherits:
-
Object
- Object
- Legion::Extensions::Llm::Inventory::Publisher
- Defined in:
- lib/legion/extensions/llm/inventory/publisher.rb
Overview
Provider-facing direct wrapper over the local Registry. It constructs and validates the exact InstanceKey from its fixed provider family and delegates to the registry with the exact kwargs. It does no retries, selection, scheduling, defaulting, or provider discovery. M7: the legacy dual-sink seam (compatibility_adapter / old-coordinator projection) is deleted — one representation, one routing authority; the SSOT registry is the only inventory sink.
Instance Method Summary collapse
-
#activate_instance_snapshot(instance_id:, publisher_token:, offerings:, sequence:, probe_token:, physical_id: nil) ⇒ Object
rubocop:disable Metrics/ParameterLists.
-
#claim_instance(instance_id:, callable:, probe_request_handle:, physical_id: nil) ⇒ Object
Every instance operation takes
instance_id:— the operator's CONFIG NAME (the identity the router keys by) — and an optionalphysical_id:carrying the physical/derived id (host:port/ak) for dedup and diagnostics only. -
#initialize(provider_family:, registry: Registry) ⇒ Publisher
constructor
A new instance of Publisher.
- #readiness_failed(instance_id:, probe_token:, reason:, physical_id: nil) ⇒ Object
- #readiness_probe_started(instance_id:, publisher_token:, physical_id: nil) ⇒ Object
- #readiness_succeeded(instance_id:, probe_token:, physical_id: nil) ⇒ Object
- #remove_instance(instance_id:, publisher_token:, physical_id: nil) ⇒ Object
- #replace_instance_snapshot(instance_id:, publisher_token:, offerings:, sequence:, physical_id: nil) ⇒ Object
- #snapshot ⇒ Object
Constructor Details
Instance Method Details
#activate_instance_snapshot(instance_id:, publisher_token:, offerings:, sequence:, probe_token:, physical_id: nil) ⇒ Object
rubocop:disable Metrics/ParameterLists
39 40 41 42 43 44 |
# File 'lib/legion/extensions/llm/inventory/publisher.rb', line 39 def activate_instance_snapshot(instance_id:, publisher_token:, offerings:, sequence:, probe_token:, physical_id: nil) # rubocop:disable Metrics/ParameterLists @registry.activate_instance_snapshot( publisher_token: publisher_token, instance_key: instance_key(instance_id: instance_id, physical_id: physical_id), offerings: offerings, sequence: sequence, probe_token: probe_token ) end |
#claim_instance(instance_id:, callable:, probe_request_handle:, physical_id: nil) ⇒ Object
Every instance operation takes instance_id: — the operator's
CONFIG NAME (the identity the router keys by) — and an optional
physical_id: carrying the physical/derived id (host:port/ak) for
dedup and diagnostics only. See Identity::InstanceKey.
28 29 30 31 |
# File 'lib/legion/extensions/llm/inventory/publisher.rb', line 28 def claim_instance(instance_id:, callable:, probe_request_handle:, physical_id: nil) key = instance_key(instance_id: instance_id, physical_id: physical_id) @registry.claim_instance(instance_key: key, callable: callable, probe_request_handle: probe_request_handle) end |
#readiness_failed(instance_id:, probe_token:, reason:, physical_id: nil) ⇒ Object
57 58 59 |
# File 'lib/legion/extensions/llm/inventory/publisher.rb', line 57 def readiness_failed(instance_id:, probe_token:, reason:, physical_id: nil) @registry.readiness_failed(instance_key: instance_key(instance_id: instance_id, physical_id: physical_id), probe_token: probe_token, reason: reason) end |
#readiness_probe_started(instance_id:, publisher_token:, physical_id: nil) ⇒ Object
33 34 35 36 37 |
# File 'lib/legion/extensions/llm/inventory/publisher.rb', line 33 def readiness_probe_started(instance_id:, publisher_token:, physical_id: nil) @registry.readiness_probe_started( instance_key: instance_key(instance_id: instance_id, physical_id: physical_id), publisher_token: publisher_token ) end |
#readiness_succeeded(instance_id:, probe_token:, physical_id: nil) ⇒ Object
53 54 55 |
# File 'lib/legion/extensions/llm/inventory/publisher.rb', line 53 def readiness_succeeded(instance_id:, probe_token:, physical_id: nil) @registry.readiness_succeeded(instance_key: instance_key(instance_id: instance_id, physical_id: physical_id), probe_token: probe_token) end |
#remove_instance(instance_id:, publisher_token:, physical_id: nil) ⇒ Object
61 62 63 |
# File 'lib/legion/extensions/llm/inventory/publisher.rb', line 61 def remove_instance(instance_id:, publisher_token:, physical_id: nil) @registry.remove_instance(instance_key: instance_key(instance_id: instance_id, physical_id: physical_id), publisher_token: publisher_token) end |
#replace_instance_snapshot(instance_id:, publisher_token:, offerings:, sequence:, physical_id: nil) ⇒ Object
46 47 48 49 50 51 |
# File 'lib/legion/extensions/llm/inventory/publisher.rb', line 46 def replace_instance_snapshot(instance_id:, publisher_token:, offerings:, sequence:, physical_id: nil) @registry.replace_instance_snapshot( publisher_token: publisher_token, instance_key: instance_key(instance_id: instance_id, physical_id: physical_id), offerings: offerings, sequence: sequence ) end |
#snapshot ⇒ Object
65 66 67 |
# File 'lib/legion/extensions/llm/inventory/publisher.rb', line 65 def snapshot @registry.snapshot end |