AshSqlite.MultiTenancy.Tenant (ash_sqlite v0.3.0)

Copy Markdown View Source

The process that owns one tenant's database: it opens and migrates the file, and its repo instance lives and dies with it.

Summary

Functions

Returns a specification to start this module under a supervisor.

The repo instance of the tenant process pid, waiting up to timeout for its database to open.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

instance(pid, timeout)

@spec instance(pid(), timeout()) ::
  {:ok, pid()} | :stopped | {:timeout, pid()} | {:error, term()}

The repo instance of the tenant process pid, waiting up to timeout for its database to open.

:stopped means the process has exited.

start_link(arg)