Skip to main content

Queues

View Markdown

Every run is started on a queue, and a runner polls one queue for the task and flow types registered on it. The orchestrator matches the two; nothing is pushed to a worker, workers pull.

val runner = connection.runner("lab").apply {
register(GreetingTask)
register(AgentRun)
start()
}

Properties

  • Registration is fixed at boot. Register everything, then start(). Registering afterwards is an error, so a queue's set of types is visible in one place.
  • A queue does not care which build is polling. Two builds on one queue is version skew; see Determinism.
  • No head-of-line blocking. A slow task does not hold up the others on the same queue.
  • A task inside a flow runs on the flow's queue unless TaskOptions.queue says otherwise. That is how a flow on the platform's queue can call a task on the ML team's queue.

Naming

One queue per deployable worker is the simple rule: gateway, ml, outbound. A queue name is part of the run's identity in the UI, so choose it once.

Remember: the queue is the boundary between who asks and who does.