Skip to main content

agent-worker

Rust supervisor and embedded CPython 3.12 runtime for registered Python async tasks.

The binary is agent-worker. The importable Python package is simple_q. The Rust module, embedded in the worker and also built as a wheel, is simple_q_runtime.

Importing simple_q does not open Redis. Call simple_q.configure(redis_url=...) after the process is the one that will send, including after a gunicorn fork. send before that call fails.

Product queues are default and quota. The decision for replacing Dramatiq is recorded in docs/adr/0001-minimal-rust-runtime-instead-of-dramatiq.md.

Metrics keep the Dramatiq names and the accounting of the fixed Prometheus middleware: canonical queue_name, both gauges in livesum, and a retry counted once when it is enqueued with a delay. Redis-scheduled retries are not in-process memory, so they do not move dramatiq_delayed_messages_inprogress. The scrape listens on DRAMATIQ_PROM_HOST:DRAMATIQ_PROM_PORT (default 0.0.0.0:9191) and any path. DRAMATIQ_PROM_DB is the multiprocess directory. The supervisor wipes *.db once; each child writes files under SIMPLE_Q_SLOT. The same directory holds simple_q_child_memory.prom with simple_q_child_memory_drains_total and simple_q_child_memory_kills_total. The scrape adds those samples. A missing file is zero.

agent-worker admin listens on 127.0.0.1:8080 and requires BOARD_TOKEN (at least 16 letters or digits), including on loopback. BOARD_INSECURE=1 omits the token only for a loopback address. Open the board once as /?token=...; the token is then kept in an HttpOnly cookie. The compose file publishes that port on the host loopback and still requires BOARD_TOKEN, because the process inside the container listens on the container network.

Redis in compose has no password and is published on 127.0.0.1:6379. Anyone who can reach it can put work on a queue. Set requirepass before sharing that port.

Tracing

The child does not open an OTLP connection. Pass Tracing to Registry and Rust spans are handed to that Python exporter on a dedicated thread. tracing=None is the default: no OpenTelemetry layer is installed, and Python is not called to export spans.

from opentelemetry.sdk.resources import Resource

from simple_q import Registry, Tracing

app = Registry(
    tracing=Tracing(
        exporter=exporter,  # export(spans) and shutdown()
        resource=Resource.create({"service.name": "agent-worker"}),
        targets={"agent_worker": "info", "simple_q_runtime": "info", "apalis": "debug"},
    )
)

RUST_LOG filters the text log. targets filters the OpenTelemetry layer, so RUST_LOG=warn still exports the process span. Omitting targets uses agent_worker=info, simple_q_runtime=info, and apalis=debug. An empty map is rejected at child startup.

Install

uv add simple-q-runtime simple-q-worker

simple-q-runtime is the importable package (import simple_q). simple-q-worker installs the agent-worker binary into the virtualenv and depends on the same version of simple-q-runtime. The binary is placed at .venv/bin/agent-worker. CPython locates that environment from pyvenv.cfg one directory above the executable, so the installed package imports without PYTHONPATH.

Wheels are Linux only, for x86_64 and aarch64. The extension wheel is a manylinux build. The binary wheel is built in python:3.12-slim-bookworm and tagged manylinux_2_36, because the binary links libpython3.12.so.1.0. Publish steps are in docs/dev/PUBLISH.md.

Metadata

Release files for simple-q-runtime 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for simple-q-runtime 0.1.1
File Size Uploaded Provenance Actions
simple_q_runtime-0.1.1.tar.gz 49.1 kB With provenance Details for simple_q_runtime-0.1.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for simple-q-runtime 0.1.1
File Interpreter ABI Platform Actions
simple_q_runtime-0.1.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details for simple_q_runtime-0.1.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
simple_q_runtime-0.1.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ ARM64 Details for simple_q_runtime-0.1.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Total release size: 2.4 MB

Release files / simple_q_runtime-0.1.1.tar.gz

Download URL simple_q_runtime-0.1.1.tar.gz
Size 49.1 kB
Tags Source
SHA-256 checksum
How to use checksums
eecfe69065cc8d0fc562d84884d1df827d8ff7bba36bcde3cac0fbf338c33f2c
BLAKE2b-256 checksum
How to use checksums
d74c88edb1e78267c1c4eb90dc9f6dbf84ff8acfe9b3f77b12b8e757338b45ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / simple_q_runtime-0.1.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL simple_q_runtime-0.1.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.2 MB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
ff1af17faca79c0b2d13f6bcdeade8dcd88c3a472c840ab10c41436857ea1c27
BLAKE2b-256 checksum
How to use checksums
50839de5d3d7d0bf008d87fe84e55b69d651c14ef00324150bc39971ea8e09ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Release files / simple_q_runtime-0.1.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL simple_q_runtime-0.1.1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 1.2 MB
Tags CPython 3.12 Linux glibc 2.17+ ARM64
SHA-256 checksum
How to use checksums
0d73b807ce36126d8a0add9d27affed9a16ed22993dfa9c85287fec1ee3e6e14
BLAKE2b-256 checksum
How to use checksums
169afd55bc21839f1af5d2deca2e42e0138d630f544649b8dee7bc3742644bf4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

Security for simple-q-runtime 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 3 files in this release have been uploaded with provenance metadata.

Select from 3 files

Attestation for simple_q_runtime-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 10, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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