Skip to main content

Module spawn

Module spawn 

Source
Expand description

db spawn — start the objectiveai-db postgres supervisor in the background.

The supervisor is per-state: its lock lives at <dir>/state/<state>/locks key db, and the lock contents are the cluster’s postgresql://... connection URL (the postmaster binds 127.0.0.1 on a random free port). If the lock is already held the cluster is already up and its published URL is returned as-is.

Modules§

request_schema
response_schema

Functions§

execute
spawn
The spawn flow itself, callable in-process (used by Context::db_client() as well as the db spawn command). Idempotent and cheap when the cluster is already up: a try_read of the lock returns the published postgresql:// URL without spawning.