Skip to main content

chp-adapter-jobs

Run any CHP capability as a polled background job. Built for heavy or long-running capabilities — e.g. huggingface.generate_image (minutes on MPS) — that outlive HTTP request timeouts.

How it works

submit runs the target capability via host.ainvoke inside a ThreadPoolExecutor and returns a job_id immediately. The target runs to completion server-side regardless of client timeouts, and — because the SQLite evidence store is thread-safe — keeps its own full evidence chain. This adapter emits only lightweight job-lifecycle events, never the target's payload or result.

Capabilities

Capability Description
chp.adapters.jobs.submit Submit {capability_id, payload}; returns a job_id.
chp.adapters.jobs.status Poll lifecycle state: submitted / running / completed / failed + duration.
chp.adapters.jobs.result Fetch a completed job's result data (ready: false while running).
chp.adapters.jobs.list List all jobs and their state.

Example: async image generation

// 1. submit — returns immediately
POST chp.adapters.jobs.submit
{ "capability_id": "chp.adapters.huggingface.generate_image",
  "payload": { "prompt": "a serene mountain lake", "output_path": "/tmp/out.png" } }
// → { "job_id": "job_ab12…", "status": "submitted" }

// 2. poll
POST chp.adapters.jobs.status   { "job_id": "job_ab12…" }   // → running … completed

// 3. fetch result
POST chp.adapters.jobs.result   { "job_id": "job_ab12…" }
// → { "ready": true, "success": true, "result": { "output_path": "/tmp/out.png", … } }

Config

Field Default Meaning
max_workers 2 Thread pool size.
allowed_capabilities None Allowlist of submittable capability ids (None = any).

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chp_adapter_jobs-0.28.0.tar.gz (7.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chp_adapter_jobs-0.28.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file chp_adapter_jobs-0.28.0.tar.gz.

File metadata

  • Download URL: chp_adapter_jobs-0.28.0.tar.gz
  • Upload date:
  • Size: 7.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.7

File hashes

Hashes for chp_adapter_jobs-0.28.0.tar.gz
Algorithm Hash digest
SHA256 f9a1c4de1bcab03d40b0f76f811b32e69bb756fda134972c2c242702d2402305
MD5 9693937c41f4a749d3c2b2cfb2c597d4
BLAKE2b-256 4b620eb35a8accacadc8a2722f68a4a05dc0915f79a40cdea0159ad41a2c9d2c

See more details on using hashes here.

File details

Details for the file chp_adapter_jobs-0.28.0-py3-none-any.whl.

File metadata

File hashes

Hashes for chp_adapter_jobs-0.28.0-py3-none-any.whl
Algorithm Hash digest
SHA256 59c12e3744582bec9205fd50bda517938da35eb377d0ddd26136dcf8ae064cd2
MD5 417f9277f85a66a9b23eb5c80ca21d82
BLAKE2b-256 bd5202731a98c8d4246ce2c9d004d9d720dd03de9f7dcba89b25e799c1c53cac

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.28.0 This release

2 files

0.27.0

2 files

0.26.0

2 files

0.25.0

2 files

0.24.0

2 files

0.23.0

1 file

0.22.0

2 files

0.21.0

2 files

0.20.0

2 files

0.19.0

2 files

0.18.0

2 files

0.17.0

2 files

0.16.0

2 files

0.15.0

2 files

0.14.0

2 files

0.13.1

2 files

0.13.0

2 files

0.12.0

2 files

0.11.0

2 files

0.10.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page