Lifecycle implementation for keyed/pooled agents.
Handles:
- Attachment tracking (attach/detach/monitor owner processes)
- Idle timer management (start/cancel/reset)
- Hibernate on shutdown (calls
Jido.Persist)
State
Adds a lifecycle sub-map to server state with:
attachments- MapSet of attached pidsattachment_monitors- Map of ref => pididle_timer- timer reference or nilidle_timeout- timeout value in millisecondspool- pool name (for logging)pool_key- pool keystorage- storage config for persistence
Events
{:attach, pid}- attach a process{:detach, pid}- detach a process:touch- reset idle timer{:down, ref, pid}- handle monitor DOWN:idle_timeout- handle idle timeout