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.



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

def initialize
  @dormant = Set.new
end

Instance Method Details

#clear!Object



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

def clear!
  @dormant.clear
end

#observe(configured_keys:, published_keys:) ⇒ Object



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

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