Skip to main content

Python client for the EntroQ task queue.

Reason this release was yanked:

Bug in postgres duration communication

Project description

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 client and a small worker framework. It speaks to EntroQ two ways:

  • EntroQJSON — talks to a Go EntroQ server over its HTTP/Connect API. Use this when a server is already running (eqpg/eqmem/eqredis serve).

  • EntroQ (in entroq.experimental.pg) — talks directly to PostgreSQL, no Go server in the path. It uses the same stored procedures the Go eqpg backend does, and bundles the canonical schema so a pip-only environment can initialize a database without a Go toolchain. Requires the pg extra.

    Experimental. Anything under entroq.experimental has no stability guarantee and may change or be removed in any release, including patches. The stable, supported path is EntroQJSON against a Go server. Pin an exact version if you depend on the direct client.

Install

pip install entroq            # client + worker (JSON/HTTP)
pip install "entroq[pg]"      # adds the direct-PostgreSQL backend (psycopg 3)

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

eq = EntroQJSON("http://localhost:8080")

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

asyncio.run(EntroQWorker(eq, "my-queue").run(process))

Talking straight to PostgreSQL instead of a server (experimental, see above):

from entroq.experimental.pg import EntroQ

eq = EntroQ("host=localhost dbname=entroq user=entroq password=secret")

A worker backed by the direct-PostgreSQL client also carries EntroQ's built-in, always-on garbage collection for /gc=-marked queues on the backend's behalf; a worker talking to a Go server does not, since the server collects for itself.

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.

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

entroq-0.12.0.tar.gz (41.3 kB view details)

Uploaded Source

Built Distribution

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

entroq-0.12.0-py3-none-any.whl (32.6 kB view details)

Uploaded Python 3

File details

Details for the file entroq-0.12.0.tar.gz.

File metadata

  • Download URL: entroq-0.12.0.tar.gz
  • Upload date:
  • Size: 41.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for entroq-0.12.0.tar.gz
Algorithm Hash digest
SHA256 4240be17787b2ffadd929c017a33f14533c4aeba436102933fd499796fdd7857
MD5 e5cc5dffb5ef7ad5cc67f6973ac14b56
BLAKE2b-256 8501bb3677c21a1cace5555016fa84105404e2fb105167d18af17d513f7260be

See more details on using hashes here.

File details

Details for the file entroq-0.12.0-py3-none-any.whl.

File metadata

  • Download URL: entroq-0.12.0-py3-none-any.whl
  • Upload date:
  • Size: 32.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for entroq-0.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 adf78151faf090f8f257cf3ff713d7046bfe3fe2ccdba46902fbd21dcb9d8dc4
MD5 e996736764d9014e566cace5d50d0c13
BLAKE2b-256 ec3bfd80a7c6f7602f25dfabc7ae0905ea97d0fdbfa33f9e72d3120819c101df

See more details on using hashes here.

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