Class: Hatchet::WorkerRuntime::DurableEviction::DurableEvictionConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/hatchet/worker/durable_eviction/manager.rb

Overview

Configuration for the background eviction loop.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(check_interval: 1.0, reserve_slots: 0, min_wait_for_capacity_eviction: 10.0) ⇒ DurableEvictionConfig

Returns a new instance of DurableEvictionConfig.



20
21
22
23
24
25
# File 'lib/hatchet/worker/durable_eviction/manager.rb', line 20

def initialize(check_interval: 1.0, reserve_slots: 0, min_wait_for_capacity_eviction: 10.0)
  @check_interval = check_interval
  @reserve_slots = reserve_slots
  @min_wait_for_capacity_eviction = min_wait_for_capacity_eviction
  freeze
end

Instance Attribute Details

#check_intervalFloat (readonly)

Returns Seconds between eviction checks.

Returns:

  • (Float)

    Seconds between eviction checks.



13
14
15
# File 'lib/hatchet/worker/durable_eviction/manager.rb', line 13

def check_interval
  @check_interval
end

#min_wait_for_capacity_evictionFloat (readonly)

Returns Minimum seconds a run must have been waiting before it becomes eligible for capacity-based eviction.

Returns:

  • (Float)

    Minimum seconds a run must have been waiting before it becomes eligible for capacity-based eviction.



18
19
20
# File 'lib/hatchet/worker/durable_eviction/manager.rb', line 18

def min_wait_for_capacity_eviction
  @min_wait_for_capacity_eviction
end

#reserve_slotsInteger (readonly)

Returns Slots to reserve from capacity-eviction decisions.

Returns:

  • (Integer)

    Slots to reserve from capacity-eviction decisions.



15
16
17
# File 'lib/hatchet/worker/durable_eviction/manager.rb', line 15

def reserve_slots
  @reserve_slots
end