Class: Legion::Extensions::Llm::Inventory::DormantWeightTracker

Inherits:
Object
  • Object
show all
Defined in:
lib/legion/extensions/llm/inventory/weight_reconciler.rb

Overview

Tracks configured weight keys that currently have no published lane.

Instance Method Summary collapse

Constructor Details

#initializeDormantWeightTracker

Returns a new instance of DormantWeightTracker.



16
17
18
# File 'lib/legion/extensions/llm/inventory/weight_reconciler.rb', line 16

def initialize
  @dormant = Set.new
end

Instance Method Details

#clear!Object



27
28
29
# File 'lib/legion/extensions/llm/inventory/weight_reconciler.rb', line 27

def clear!
  @dormant.clear
end

#observe(configured_keys:, published_keys:) ⇒ Object



20
21
22
23
24
25
# File 'lib/legion/extensions/llm/inventory/weight_reconciler.rb', line 20

def observe(configured_keys:, published_keys:)
  current = Set.new(configured_keys).difference(published_keys)
  newly_dormant = current.difference(@dormant).sort_by(&:inspect)
  @dormant.replace(current)
  newly_dormant
end