EmbeddedAgentInfo

data class EmbeddedAgentInfo(agent: Agent)(source)

Lifecycle handle for an Agent started in the background of a host JVM.

Returned by Agent.startAsyncAgent, this is the supported way for embedders to interact with an Agent they did not construct directly. The underlying Agent instance is intentionally hidden so consumers depend only on this stable, minimal surface — identity (for logging and metrics correlation) and shutdown.

The handle is a Kotlin data class purely to inherit value-equality and toString(); do not copy() or destructure it. The private val agent is the canonical owner of the running Agent, and holding multiple EmbeddedAgentInfo instances pointing at the same Agent is supported but not idiomatic.

Example

val info = Agent.startAsyncAgent("/etc/prom-proxy/agent.conf", exitOnMissingConfig = false)
logger.info { "Started agent ${info.agentName} (launchId=${info.launchId})" }
// ... later, during host-app shutdown:
info.shutdown()

Constructors

Link copied to clipboard
constructor(agent: Agent)

Properties

Link copied to clipboard

See class-level KDoc.

Link copied to clipboard

See class-level KDoc.

Functions

Link copied to clipboard
fun shutdown()

Gracefully stops the embedded Agent.