Install
Published on PyPI and mirrored in
GitHub Releases. Pin the
exact 0.1.0a36 prerelease:
pip install outlabs-taskq==0.1.0a36
# with extras:
pip install "outlabs-taskq[http]==0.1.0a36"
pip install "outlabs-taskq[outlabs]==0.1.0a36"
Requires Python 3.12+ and PostgreSQL 16+ (18 is the preferred deploy target).
Dependency tiers
| Install | What you get | Hard deps |
|---|---|---|
outlabs-taskq | Migrator, models, asyncio SQL client, worker loop, CLI | pydantic, sqlalchemyasyncio, asyncpg, croniter |
[http] | Facade app + HTTP clients + claim-wait hub | fastapi, httpx |
[outlabs] | OutLabs queue authorizer + IAM provisioning | [http] + outlabs-auth>=0.1.0a27,<0.2.0 |
import taskq must succeed without FastAPI and without outlabs-auth.Install the schema
Use the CLI (preferred) or call the migrator from your host migration tool. First create a secret-free named context as shown in the CLI reference, with the DSN supplied by its named environment variable:
taskq --context development db plan -o json
taskq --context development --yes db migrate --plan-digest "$PLAN_DIGEST"
taskq --context development db verify
On a fresh scheduler-capable database, the first apply intentionally stops
after migration 0019 with code CLI_TARGET_BINDING_REQUIRED. Inspect
target show, bind the installation with exact UUID/CAS values, then produce a
fresh plan digest and resume. No command binds or migrates implicitly.
from taskq.sql import migrate_sync, verify_sync
def upgrade():
# Alembic / host revision — run as a Postgres admin that can create roles
migrate_sync(op.get_bind())
report = verify_sync(op.get_bind())
assert report.ok
There is no install() helper. db migrate applies packaged SQL (0001–0042)
under an advisory lock; verify is the read-only drift oracle (catalog,
grants, checksums) for SQL contract 0.6.6. Run both with an administrative
deployment credential, not a runtime capability role.
Capability roles
The installer creates six roles (ADR-010):
| Role | Purpose |
|---|---|
taskq_owner | Owns schema objects |
taskq_producer | Enqueue |
taskq_runner | Claim / heartbeat / settle |
taskq_observer | Stats / read views |
taskq_operator | Redrive / cancel / control |
taskq_housekeeper | Tick / reaper |
Host apps call migrate / verify — do not fork the SQL in-tree. Programmatic
migration still obeys the same target-binding gate.