Configuring Queues
Assigning Workers to Queues
Each worker polls exactly one task queue, specified via the builder API:
1use orcher::prelude::*;23#[tokio::main(flavor = "current_thread")]4async fn main() -> Result<()> {5 // This worker polls the "payments" queue6 let worker = WorkerBuilder::new()7 .server_url("http://localhost:50051")8 .namespace("production")9 .task_queue("payments")10 .max_concurrent_workflows(100)11 .max_concurrent_tasks(200)12 .build()13 .await?;1415 worker.run().await16}Queue Isolation by Workload
Use separate queues to match workers to their workload characteristics:
1// CPU-intensive work — deploy on compute-optimized instances2let compute_worker = WorkerBuilder::new()3 .task_queue("ml-inference")4 .max_concurrent_tasks(10) // Low concurrency for CPU tasks5 .build().await?;67// I/O-intensive work — deploy on network-optimized instances8let io_worker = WorkerBuilder::new()9 .task_queue("api-calls")10 .max_concurrent_tasks(500) // High concurrency for I/O tasks11 .build().await?;1213// Payment processing — dedicated, high-reliability workers14let payment_worker = WorkerBuilder::new()15 .task_queue("payments")16 .max_concurrent_tasks(50)17 .build().await?;Namespace Isolation
Namespaces provide complete queue isolation for multi-tenancy and environment separation. Two workers polling the same queue name in different namespaces will never receive each other's work:
1# Development workers2ORCHER_NAMESPACE=development ./my-worker34# Production workers5ORCHER_NAMESPACE=production ./my-worker67# Per-tenant isolation8ORCHER_NAMESPACE=tenant-acme ./my-workerNext Steps
- Queues Overview — How queues work in Orcher
- Polling & Dead Letter Queue — Tune pollers, configure retries, and enable Redis fast path
- Monitoring & Troubleshooting — CLI commands, auto-scaling, and common issues