Skip to main content

Python client for the EntroQ task queue.

Reason this release was yanked:

pg-only needed to be in experimental

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.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.

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:

from entroq.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.11.0.tar.gz (40.4 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.11.0-py3-none-any.whl (31.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for entroq-0.11.0.tar.gz
Algorithm Hash digest
SHA256 8ca4c36515522f401a6dcc0a4235f4bfbc8b0fb7b9f437d2ed7f34c8f41d4c8e
MD5 0d9f0f5da96c66c1e5eca118b69d962d
BLAKE2b-256 c369e9d54eda8aa703bb34cab46550c94c7a0d9862de61ee319b5a7a972fca00

See more details on using hashes here.

File details

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

File metadata

  • Download URL: entroq-0.11.0-py3-none-any.whl
  • Upload date:
  • Size: 31.8 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.11.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c14f7709de948532aacde873eca732d584dde73fc36b8ae6c57b2bbf06cffc7
MD5 ce930789c8dd3e4a3ab23e23c892ca87
BLAKE2b-256 a0c585e39ff6880ec297f6b07312e7de2bbbd63e5ea8e7b0945bd588143d461d

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