Skip to main content

EntroQ (Python client)

Python client for EntroQ, a fault-tolerant, competing-consumer task queue with exactly-once semantics and an atomic Modify operation over tasks and a companion key/value doc store.

This package provides an async HTTP/Connect client and a small worker framework. Run one of the Go services (eqpg serve, eqmem serve, eqredis serve, or eqsqlite serve) and connect with EntroQJSON.

Install

pip install entroq

Quick start

A worker claims tasks from one or more queues and dispatches them to a handler:

import asyncio
from entroq import EntroQWorker, Modification
from entroq.json import EntroQJSON

@EntroQWorker.handler
async def process(task, docs):
    # ... do the work ...
    return Modification(Modification.deleting(task))   # ack by deleting

async def main():
    async with EntroQJSON("http://localhost:8080") as eq:
        await EntroQWorker(eq, "my-queue").run(process)

asyncio.run(main())

The default HTTP client has no transport deadline. Cancel the calling asyncio task directly, wrap it in asyncio.timeout(), or pass timeout_s to claim() when a bounded wait is required. The client exposes its configured httpx.AsyncClient as eq.http; pass http_client= to supply a customized caller-owned client and timeout policy. Injected clients are not closed by eq.aclose(). Transport failures raise TransportError, preserving the original exception and indicating whether the request is known to be safe to retry.

Documentation

See the main repository for the concepts (tasks, claims, the atomic Modify, the doc store, and the /gc= naming convention) and the server/backends the Go side provides.

Metadata

Release files for entroq 0.14.0

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

Source distribution (sdist)

Source distribution for entroq 0.14.0
File Size Uploaded
entroq-0.14.0.tar.gz 30.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for entroq 0.14.0
File Interpreter ABI Platform
entroq-0.14.0-py3-none-any.whl Python 3 none any Details

Total release size: 51.7 kB

Release files / entroq-0.14.0.tar.gz

Download URL entroq-0.14.0.tar.gz
Size 30.1 kB
Tags Source
SHA-256 checksum
How to use checksums
bd8dc5637697d1f49ca7c1f1f858f1ac20a8b9b2f74e4d2ec59aa24909899cd0
BLAKE2b-256 checksum
How to use checksums
ba797b26cfd93526ed0a446eb333ebfa0e27dafbdf8d9d89886f4d221744a4a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release files / entroq-0.14.0-py3-none-any.whl

Download URL entroq-0.14.0-py3-none-any.whl
Size 21.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8d68b7c6a32a94e46f76987fa5c135c3e5af44efbfb3a1199b8d29edd6e65fbe
BLAKE2b-256 checksum
How to use checksums
71dcf2310aa692c7e7c6815ef49ed02180a257c308a8c08711d362a1905f8333
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.14

Release history Release notifications | RSS feed

This release

0.14.0 This release

2 release files

0.13.1

2 release files

0.13.0

2 release files

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