Class: Legion::Extensions::Llm::Vllm::Actor::DiscoveryRefresh

Inherits:
Actors::Every
  • Object
show all
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

Instance Method Details

#run_now?Boolean

Returns:

  • (Boolean)


23
# File 'lib/legion/extensions/llm/vllm/actors/discovery_refresh.rb', line 23

def run_now?        = true

#runner_classObject



25
# File 'lib/legion/extensions/llm/vllm/actors/discovery_refresh.rb', line 25

def runner_class    = 'Legion::Extensions::Llm::Vllm::Runners::DiscoveryRefresh'

#runner_functionObject



26
# File 'lib/legion/extensions/llm/vllm/actors/discovery_refresh.rb', line 26

def runner_function = 'refresh'

#shutdownObject



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

#timeObject

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

Returns:

  • (Boolean)


24
# File 'lib/legion/extensions/llm/vllm/actors/discovery_refresh.rb', line 24

def use_runner?     = false