---
kind: Job
name: worker
runtime:
  one_of: process
  command: /bin/echo worker processing batch
timeout: 300s
env:
  QUEUE_URL: unix:///run/orca/alloc-worker/queue.sock
  BATCH_SIZE: "100"
  LOG_LEVEL: debug
lifecycle:
  post_start:
    - /bin/sh -c 'echo worker registered'
  pre_stop:
    - /bin/sh -c 'echo draining worker queue'
---
# Worker

One-shot batch worker that processes items from a queue. Runs once,
exits on completion or after 300s timeout. Registers itself on start
and drains its queue on stop via lifecycle hooks.

> **Production substitution**: replace `runtime.command` with your
> actual worker binary, e.g. `/usr/bin/python3 /opt/orca/jobs/worker.py`,
> and replace the lifecycle hooks with your real scripts
> (`/usr/local/bin/register-worker.sh`, `/usr/local/bin/drain-queue.sh`).