Class: Legion::Extensions::Llm::Vertex::RegistryPublisher
- Inherits:
-
Object
- Object
- Legion::Extensions::Llm::Vertex::RegistryPublisher
- Defined in:
- lib/legion/extensions/llm/vertex/registry_publisher.rb
Overview
Best-effort publisher for Vertex provider availability events.
Constant Summary collapse
- APP_ID =
'lex-llm-vertex'
Instance Method Summary collapse
-
#initialize(builder: RegistryEventBuilder.new) ⇒ RegistryPublisher
constructor
A new instance of RegistryPublisher.
- #publish_offerings_async(offerings, readiness:) ⇒ Object
- #publish_readiness_async(readiness) ⇒ Object
Constructor Details
#initialize(builder: RegistryEventBuilder.new) ⇒ RegistryPublisher
Returns a new instance of RegistryPublisher.
11 12 13 |
# File 'lib/legion/extensions/llm/vertex/registry_publisher.rb', line 11 def initialize(builder: RegistryEventBuilder.new) @builder = builder end |
Instance Method Details
#publish_offerings_async(offerings, readiness:) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/legion/extensions/llm/vertex/registry_publisher.rb', line 19 def publish_offerings_async(offerings, readiness:) schedule do Array(offerings).each do |offering| publish_event(@builder.offering_available(offering, readiness:)) end end end |
#publish_readiness_async(readiness) ⇒ Object
15 16 17 |
# File 'lib/legion/extensions/llm/vertex/registry_publisher.rb', line 15 def publish_readiness_async(readiness) schedule { publish_event(@builder.readiness(readiness)) } end |