AgentRegistryObserver

Observer hook notified when an agent — Agent (setup-time or transient/runtime), PermanentAgent, or AgentResource — is constructed and registered with this model. Its purpose is to hand external/integration/reporting code a reference to every agent that comes into existence, including transient agents created during a replication that are not in the agents registry and could not otherwise be referenced.

Timing: fires from the agent's base constructor. The agent's AgentLike.mailbox is available (so a MailboxObserver can be attached immediately), but a statechart configured in a subclass init { statechart { ... } } is not installed yet — attach a StatechartObserver when the chart is built, or read agent.statechart later. There is intentionally no disposal/deregistration counterpart: transient agents may simply be garbage-collected, so end-of-life is not reliably observable here — observe a process completion or a statechart final state instead.

Attach via attachRegistryObserver; non-suspending, so it is safe to call from coroutine-free integration code.

Functions

Link copied to clipboard
open fun onAgentRegistered(agent: AgentLike)