Skip to main content
Source: demo/queue/app.py in the repository. Background work: one task per item, in its own container, with retries. Use it for anything you do not want a caller to wait for: file processing, transcription, batch scoring.
Notes
  • retries=2 re-runs a task if the container crashes; timeout caps how long one task may take.
  • keep_warm_seconds keeps a worker container alive between tasks so a steady trickle does not pay a cold start each time; autoscaler=QueueDepthAutoscaler(...) adds containers when the queue grows.
  • on_start= runs once per container before the first task, for loading a model or warming a cache.
  • The dashboard’s Apps page shows the queue with its tasks, and Containers shows the workers.