Class: Legion::Extensions::Llm::Vllm::Actor::DiscoveryRefresh
- Inherits:
-
Actors::Every
- Object
- Actors::Every
- Legion::Extensions::Llm::Vllm::Actor::DiscoveryRefresh
- Includes:
- Helpers::Lex
- Defined in:
- lib/legion/extensions/llm/vllm/actors/discovery_refresh.rb
Overview
Periodic trigger for vLLM discovery. Stateless: it fires on the configured discovery interval and dispatches to Runners::DiscoveryRefresh, which owns the work and holds its process-local instance state.
Instance Method Summary collapse
- #run_now? ⇒ Boolean
- #runner_class ⇒ Object
- #runner_function ⇒ Object
- #shutdown ⇒ Object
-
#time ⇒ Object
Honor the registered discovery interval.
- #use_runner? ⇒ Boolean
Instance Method Details
#run_now? ⇒ Boolean
23 |
# File 'lib/legion/extensions/llm/vllm/actors/discovery_refresh.rb', line 23 def run_now? = true |
#runner_class ⇒ Object
25 |
# File 'lib/legion/extensions/llm/vllm/actors/discovery_refresh.rb', line 25 def runner_class = 'Legion::Extensions::Llm::Vllm::Runners::DiscoveryRefresh' |
#runner_function ⇒ Object
26 |
# File 'lib/legion/extensions/llm/vllm/actors/discovery_refresh.rb', line 26 def runner_function = 'refresh' |
#shutdown ⇒ Object
36 37 38 39 40 |
# File 'lib/legion/extensions/llm/vllm/actors/discovery_refresh.rb', line 36 def shutdown Legion::Extensions::Llm::Vllm::Runners::DiscoveryRefresh.remove_all_instances rescue StandardError => e handle_exception(e, level: :warn, operation: 'vllm.actor.discovery_refresh.shutdown') end |
#time ⇒ Object
Honor the registered discovery interval. A nil TimerTask interval fires once and then stops, so resolve to the registered default (300s) whenever the setting is missing or non-positive.
31 32 33 34 |
# File 'lib/legion/extensions/llm/vllm/actors/discovery_refresh.rb', line 31 def time interval = settings.dig(:discovery, :interval_seconds)&.to_i interval&.positive? ? interval : 300 end |
#use_runner? ⇒ Boolean
24 |
# File 'lib/legion/extensions/llm/vllm/actors/discovery_refresh.rb', line 24 def use_runner? = false |