Skip to main content

Standard inbox/outbox worker runtime for MetaSPN agent systems

Project description

metaspn-ops

Standard inbox/outbox worker runtime for MetaSPN agent systems.

Features

  • Filesystem queue backend with inbox/outbox semantics
  • Task leasing with lock files and lease expiration
  • Retries with exponential backoff and dead-letter queue
  • Worker runner with polling and parallel execution
  • CLI for worker runs and queue operations

Installation

pip install metaspn-ops

Quickstart

1) Define a worker

# example_worker.py
from metaspn_ops import Result, Task


class EnrichWorker:
    name = "enrich"

    def handle(self, task: Task) -> Result:
        payload = {"seen": task.payload}
        return Result(task_id=task.task_id, status="ok", payload=payload)

2) Run a worker once

metaspn worker run example_worker:EnrichWorker --workspace . --once --max-tasks 10

3) Queue inspection

metaspn queue stats enrich --workspace .
metaspn queue deadletter list enrich --workspace .
metaspn queue retry enrich --workspace .

Queue layout

workspace/
  inbox/{worker_name}/
  outbox/{worker_name}/
  runs/{worker_name}/
  deadletter/{worker_name}/
  locks/{worker_name}/

Development

python -m venv .venv
source .venv/bin/activate
pip install -e .[dev]
PYTHONPATH=src python -m unittest discover -s tests -v
python -m build
python -m twine check dist/*

Release

  • Tag a release in GitHub (for example v0.1.0).
  • GitHub Actions builds and publishes to PyPI using trusted publishing.
  • Configure a PyPI Trusted Publisher for this repository before the first release.
  • See /Users/leoguinan/MetaSPN/metaspn-ops/PUBLISHING.md for the full flow.

License

MIT

Project details


Download files

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

Source Distribution

metaspn_ops-0.1.0.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

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

metaspn_ops-0.1.0-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file metaspn_ops-0.1.0.tar.gz.

File metadata

  • Download URL: metaspn_ops-0.1.0.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for metaspn_ops-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2268588b80f4ce6af4b8174ef3c8c408cbb1f7079da336dbfecbbfc195fca827
MD5 4f88bea6721617493089b83bdf1ef3dc
BLAKE2b-256 38936838b6a0dc8a459f23d04f3bc21599824115e06b66a4c951cd1d9d7c2e66

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaspn_ops-0.1.0.tar.gz:

Publisher: publish.yml on MetaSPN/metaspn-ops

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file metaspn_ops-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: metaspn_ops-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for metaspn_ops-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e690e24d71f8e2b4a94e2214717bbdb95a342e473cf76c07f2ee9e6d0541d324
MD5 50f44b0c15fb1afea4dc18bd49490520
BLAKE2b-256 a9fa5e19baded127f4869ed83bcf854a2a51f19b68ea13963a21f661a7836cd1

See more details on using hashes here.

Provenance

The following attestation bundles were made for metaspn_ops-0.1.0-py3-none-any.whl:

Publisher: publish.yml on MetaSPN/metaspn-ops

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page