Store job results
This example groups a result, status and removal of a pending marker in one namespace batch. Use the quickstart to create the disk and obtain a project API key.
Record a completed job
Section titled “Record a completed job”curl --fail-with-body --no-buffer \ "https://api.wabe.sh/v1/disks/demo/exec?kind=js" \ -H "Authorization: Bearer YOUR_PROJECT_API_KEY" \ --data-binary @- <<'JS'const jobs = kv.namespace('jobs');await jobs.batch([ {op:'put', key:'42:result', value:{files:3, warnings:0}}, {op:'put', key:'42:status', value:'done'}, {op:'delete', key:'42:pending'},]);await fs.flush();return {id:'42', status:await jobs.get('42:status')};JSThe batch publishes its mutations together. This recipe explicitly waits for disk persistence before returning. A disconnect can still leave the mutation applied; inspect the recorded job before retrying.
Read from an HTTP client
Section titled “Read from an HTTP client”curl --fail-with-body "https://api.wabe.sh/v1/disks/demo/kv/jobs" \ -H "Authorization: Bearer YOUR_PROJECT_API_KEY" \ --json '{"op":"get","key":"42:result"}'{"type":"json","value":{"files":3,"warnings":0}}List a job’s state
Section titled “List a job’s state”curl --fail-with-body --no-buffer "https://api.wabe.sh/v1/disks/demo/kv/jobs" \ -H "Authorization: Bearer YOUR_PROJECT_API_KEY" \ --json '{"op":"scan","prefix":"42:"}'One scan reads the job’s result and status in its scan view. Separate get calls can observe intervening writes. The API has no compare-and-set, lock or queue primitive. See KV semantics before building a job dispatcher.