cd demo/queue
# from Python: enqueue five tasks and wait until each is COMPLETE
python app.py
# 703e7c4e-… COMPLETE (what a task prints is in its logs: levers9 task list, then the dashboard's Apps page)
# deploy it so other systems can enqueue over HTTP
levers9 deploy app.py:resize --name resize
TOKEN=$(awk -F' = ' '/^\[default\]/{f=1} f&&/^token/{print $2; exit}' ~/.levers9/config)
curl -s -X POST localhost:1994/queue/resize/v1 \
-H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
-d '{"image_id": "img-from-curl", "width": 1024}'
# {"task_id": "..."}
# watch the work
levers9 task list
levers9 task list --status COMPLETE
levers9 task stop `task id`