Class: Legion::Extensions::Llm::Inventory::DormantWeightTracker
- Inherits:
-
Object
- Object
- Legion::Extensions::Llm::Inventory::DormantWeightTracker
- 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
- #clear! ⇒ Object
-
#initialize ⇒ DormantWeightTracker
constructor
A new instance of DormantWeightTracker.
- #observe(configured_keys:, published_keys:) ⇒ Object
Constructor Details
#initialize ⇒ DormantWeightTracker
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 |