AgentContextCleanupService

internal class AgentContextCleanupService(proxy: Proxy, configVals: ConfigVals.Proxy2.Internal2, initBlock: AgentContextCleanupService.() -> Unit = {}) : GenericExecutionThreadService(source)

Background service that periodically evicts stale agent contexts.

Runs a loop that checks for agents whose last activity exceeds maxAgentInactivitySecs. Stale agents are removed from the path map and context manager, and their in-flight scrape requests are failed. A TOCTOU re-check guards against evicting agents that sent a heartbeat between the scan and the eviction.

Parameters

proxy

the parent Proxy instance

configVals

internal proxy configuration (inactivity timeout, check interval)

initBlock

optional initialization block run after listener registration

See also

Constructors

Link copied to clipboard
constructor(proxy: Proxy, configVals: ConfigVals.Proxy2.Internal2, initBlock: AgentContextCleanupService.() -> Unit = {})

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun addListener(listener: Service.Listener, executor: Executor)
Link copied to clipboard
fun awaitRunning(timeout: Duration)
fun awaitRunning(timeout: Long, unit: TimeUnit)
Link copied to clipboard
fun awaitTerminated(timeout: Long, unit: TimeUnit)
Link copied to clipboard
Link copied to clipboard
@CanIgnoreReturnValue
fun startAsync(): Service
Link copied to clipboard
fun startSync(timeout: Duration)
Link copied to clipboard
fun state(): Service.State
Link copied to clipboard
@CanIgnoreReturnValue
fun stopAsync(): Service
Link copied to clipboard
fun stopSync(timeout: Duration)
Link copied to clipboard
open override fun toString(): String