Fact.Bootstrapper (Fact v0.2.0)

View Source

Boots a Fact database from disk.

The bootstrapper read the genesis event (see Fact.Genesis.Event.DatabaseCreated.V1) from the specified path, builds a Fact.Context, and starts the database under a Fact.DatabaseSupervisor.

On success, the database is started and the bootstrapping process stops normally. If a caller PID is provided in the options, it will receive:

  • {:database_started, database_id}

This process is temporary and is intended to run during startup.

Summary

Functions

Returns a specification to start this module under a supervisor.

Types

option()

@type option() :: {:path, Path.t()} | {:caller, pid()}

options()

@type options() :: [option()]

Functions

child_spec(init_arg)

@spec child_spec(options()) :: Supervisor.child_spec()

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts)

@spec start_link(options()) :: GenServer.on_start()