Tursox.Manager (tursox v0.2.1)

Copy Markdown View Source

Optional caller-supervised manager for many independent database pools.

Managers are addressed by pid or caller-selected name. Tursox starts no singleton, registry, or dynamic atoms.

Summary

Functions

Returns a specification to start this module under a supervisor.

Gracefully removes and closes one entry.

Fetches a pool with an explicit not-found error.

Lists safe entry metadata without options, SQL, values, or secrets.

Returns a pool pid or nil.

Atomically opens one owned database/pool entry.

Starts an isolated manager.

Stops the manager and drains every owned entry.

Types

id()

@type id() :: term()

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

close(manager, id, opts \\ [])

Gracefully removes and closes one entry.

fetch(manager, id)

Fetches a pool with an explicit not-found error.

list(manager)

Lists safe entry metadata without options, SQL, values, or secrets.

lookup(manager, id)

Returns a pool pid or nil.

open(manager, id, database, opts \\ [])

@spec open(GenServer.server(), id(), :memory | String.t(), keyword()) ::
  {:ok, pid()} | {:error, Tursox.Error.t()}

Atomically opens one owned database/pool entry.

start_link(opts \\ [])

Starts an isolated manager.

stop(manager, timeout \\ 15000)

Stops the manager and drains every owned entry.