OutlabsTaskq
Reference

Configuration

Queue profiles and WorkerSettings / TASKQ_* knobs.

Queue profiles

Rich defaults live on taskq.queues and are stamped onto each job at enqueue:

  • max_attempts, lease seconds, retry backoff
  • default priority
  • retention windows
  • optional depth limit

Changing a queue profile affects future enqueues only.

The queue profile also carries the per-queue flow-control fields — in-flight cap (max_running), rate limits (claim_rate_per_minute / claim_burst), slow-start ramp_seconds, the circuit-breaker and priority-aging settings, and key-space fairness via flow_limits. Unlike the fields above, these gate the claim path rather than stamp jobs, and every one is off by default. Set them with the operator verbs documented in Flow control.

WorkerSettings (TASKQ_*)

KnobDefaultNotes
dsn or http_base_urlExactly one transport
registryrequiredmodule:attr exporting TaskRegistry
queuesrequiredOne or more queue names
environmentrequiredMust match expected_environment when set
worker_idautoOptional; CLI generates a default
concurrency1Max in-flight handlers
sync_workersconcurrencyThread slots available to ctx.run_sync(...)
batch1Claim batch size (≤ concurrency)
poll_interval5Seconds
listentrueDSN only; HTTP workers must disable
presence_interval60Seconds
soft_stop_timeoutnoneWait forever if unset
allow_productionfalseRequired when environment=production
expected_environmentOptional hard check against the declared environment
expected_installation_idrequired for direct-SQL productionStatic database identity pin
http_bearer_token / header pairExactly one credential source for HTTP
http_claim_wait_seconds25Long-poll; multi-queue HTTP requires 0
pool_sizeconcurrency+2DSN workers only

CLI flags mirror these fields (taskq worker run --help). Operator connections use secret-free named contexts; see the CLI reference. Supervised host wrappers may instead use --dsn-env TASKQ_DSN; this passes only the environment-variable name in process arguments and leaves the credential in the supervisor's secret environment.

Scheduler settings (TASKQ_*)

KnobDefaultNotes
dsnrequiredScheduler runtime credential; keep it out of CLI history
expected_environment / TASKQ_EXPECTED_ENVrequiredStatic expected target environment
expected_installation_idrequired in productionStatic UUID pin from deployment configuration
allow_productionfalseMust be explicitly true for production
worker_idgeneratedScheduler process identity used in durable decisions
poll_interval5Seconds between continuous cycles
jitter0.1Bounded poll jitter, from 0 to 0.5
backoff_cap30Maximum error backoff in seconds
claim_limit10Schedules claimed per batch
lease_seconds60Schedule-claim lease, from 5 to 300 seconds
error_retry_seconds30Retry delay for scheduler evaluation errors
pool_size2Scheduler database pool size

The runtime never fills expected target values by reading the database. In production it requires both TASKQ_EXPECTED_INSTALLATION_ID and TASKQ_ALLOW_PRODUCTION=true.

See Standalone Scheduler for target binding, manifests, activation, monitoring, and rollback.