Getting Started
Install
Install the package and choose the right extras.
pip install outlabs-taskq # core: SQL client + worker runtime
pip install outlabs-taskq[http] # + FastAPI facade / HTTP worker client
pip install outlabs-taskq[outlabs] # + outlabs-auth adapter for facade auth
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 | outlabs-auth |
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:
taskq migrate "postgresql://postgres:postgres@localhost:5432/myapp"
taskq verify "postgresql://postgres:postgres@localhost:5432/myapp"
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. migrate applies packaged SQL under an advisory lock; verify is the read-only drift oracle (catalog, grants, checksums).
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.