Services.NamePool (fnord v0.8.82)
View SourceA service that manages a pool of AI agent names, batch-allocating them from the nomenclater for efficiency. Names can be checked out and optionally checked back in for reuse within the same session.
Each checked-out name is now associated with the caller's pid, and you can
retrieve it via get_name_by_pid/1.
The pool allocates names in chunks sized to the configured workers setting to maximize API efficiency without overwhelming the connection pool.
Summary
Functions
Restores the association between a pid and a name. This is useful to
re-associate a name after a process restart or similar event.
Checks a name back into the pool for potential reuse. This is optional - names that are never checked back in will simply be lost when the session ends.
Checks out a name from the pool. If the pool is empty or running low, automatically allocates a new chunk of names.
Returns a specification to start this module under a supervisor.
Returns {:ok, name} if the given pid has a checked‐out name,
or {:error, :not_found} otherwise.
Returns pool statistics for debugging/monitoring
Resets the pool state (mainly for testing)
Starts the name pool service
Types
Functions
Restores the association between a pid and a name. This is useful to
re-associate a name after a process restart or similar event.
Checks a name back into the pool for potential reuse. This is optional - names that are never checked back in will simply be lost when the session ends.
Checks out a name from the pool. If the pool is empty or running low, automatically allocates a new chunk of names.
Returns {:ok, name} or {:error, reason}.
Returns a specification to start this module under a supervisor.
See Supervisor.
Returns {:ok, name} if the given pid has a checked‐out name,
or {:error, :not_found} otherwise.
Returns pool statistics for debugging/monitoring
Resets the pool state (mainly for testing)
Starts the name pool service