OutlabsTaskq
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

InstallWhat you getHard deps
outlabs-taskqMigrator, models, asyncio SQL client, worker loop, CLIpydantic, sqlalchemyasyncio, asyncpg, croniter
[http]Facade app + HTTP clients + claim-wait hubfastapi, httpx
[outlabs]OutLabs queue authorizer + IAM provisioningoutlabs-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):

RolePurpose
taskq_ownerOwns schema objects
taskq_producerEnqueue
taskq_runnerClaim / heartbeat / settle
taskq_observerStats / read views
taskq_operatorRedrive / cancel / control
taskq_housekeeperTick / reaper

Host apps call migrate / verify — do not fork the SQL in-tree.