Multi-tenant fairness
Enqueues a backlog of 200 jobs for a big tenant, then 5 jobs for a small tenant, and runs them with Fairness: true and PerKeyLimit: 3. The small tenant finishes long before the backlog drains.
Run
docker compose -f deploy/docker-compose.yml up -d --wait postgres
go run ./examples/multi-tenant-fairness
The example connects to FOREMAN_DATABASE_URL (default
postgres://foreman:foreman@localhost:55432/foreman?sslmode=disable) and recreates its own schema
on every run.
Expected output
small tenant served before the backlog drained: true