Skip to main content

zerodb-rq

Python RQ-compatible task queue backed by ZeroDB. No Redis required -- auto-provisions on first use.

PyPI License: MIT

Why zerodb-rq?

Python RQ Celery zerodb-rq
Requires Redis Redis/RabbitMQ Nothing
Setup Install + configure Redis Install + configure broker pip install zerodb-rq
Persistence Redis (volatile) Configurable ZeroDB (cloud, durable)
Auto-provisioning No No Yes (free, no signup)

Installation

pip install zerodb-rq

Quick Start

Enqueue Jobs

from zerodb_rq import Queue

def send_email(to, subject, body):
    print(f"Sending email to {to}: {subject}")

q = Queue()  # auto-provisions ZeroDB
job = q.enqueue(send_email, "alice@example.com", "Hello", body="Hi there")
print(f"Job {job.id} enqueued")

Run a Worker

from zerodb_rq import Queue, Worker

q = Queue()
w = Worker([q])
w.work()  # Polls and executes jobs

Burst Mode (Run Once)

w = Worker([q])
w.work(burst=True)  # Process all queued jobs, then stop

How It Works

  1. Queue.enqueue() serializes the function call and stores it in a ZeroDB table (rq_jobs)
  2. Worker.work() polls the table for queued jobs, dequeues them FIFO, and executes
  3. Results are stored in a separate ZeroDB table (rq_results)
  4. On first use, ZeroDB is auto-provisioned (free, no signup)

API Reference

Queue(name="default", api_key=None, project_id=None)

Method Description
enqueue(func, *args, **kwargs) Add a job to the queue
enqueue_call(func, args, kwargs) Add a job with explicit args
count() Number of queued jobs
is_empty Whether the queue is empty
empty() Remove all queued jobs
fetch_job(job_id) Get a specific job
get_jobs() List all queued jobs
dequeue() Pop the next job
fetch_result(job_id) Get a completed job's result

Worker(queues, poll_interval=1)

Method Description
work(burst=False, max_jobs=None) Start processing jobs
stop() Signal graceful shutdown
is_running Whether the worker is active
total_completed Jobs completed count
total_failed Jobs failed count

Job

Attribute Description
id Unique job identifier
func_name Dotted function path
args Positional arguments
kwargs Keyword arguments
status queued / started / finished / failed
result Return value (after execution)
error Error message (if failed)

Configuration

Explicit Credentials

q = Queue(api_key="your-api-key", project_id="your-project-id")

Environment Variables

export ZERODB_API_KEY="your-api-key"
export ZERODB_PROJECT_ID="your-project-id"

Credential Resolution Order

  1. Constructor arguments
  2. Environment variables (ZERODB_API_KEY, ZERODB_PROJECT_ID)
  3. Config file (~/.zerodb/config.json)
  4. Auto-provision (free, no signup)

Examples

Multiple Queues

high = Queue(name="high-priority")
low = Queue(name="low-priority")

high.enqueue(critical_task, data)
low.enqueue(background_task, data)

# Worker processes high-priority first
w = Worker([high, low])
w.work()

Custom Job ID

job = q.enqueue(process_order, order_id, job_id=f"order-{order_id}")

Job Results

job = q.enqueue(calculate, 42)
# ... later, after worker processes it ...
result = q.fetch_result(job.id)

License

MIT


Powered by ZeroDB + AINative

ZeroDB is a serverless database with auto-provisioning, vector search, and NoSQL tables. Build AI-native apps without managing infrastructure.

Metadata

Release files for zerodb-rq 0.1.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 zerodb-rq 0.1.0
File Size Uploaded Provenance
zerodb_rq-0.1.0.tar.gz 12.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for zerodb-rq 0.1.0
File Interpreter ABI Platform
zerodb_rq-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.7 kB

Release files / zerodb_rq-0.1.0.tar.gz

Download URL zerodb_rq-0.1.0.tar.gz
Size 12.4 kB
Tags Source
SHA-256 checksum
How to use checksums
35bb7be414618b622c78e002355e8ea8d32c3f1fd261e829b1ebd9e9cd419424
BLAKE2b-256 checksum
How to use checksums
841452bf68950361e2461b4037fef68fd2990fd531a8a4308e7d7b0427b56f8a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / zerodb_rq-0.1.0-py3-none-any.whl

Download URL zerodb_rq-0.1.0-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bb55865938126c9c9dbb727371157457eb9bcd84a5f8da3dc56a3095935b301c
BLAKE2b-256 checksum
How to use checksums
0b9fd34c5d3e4a00e72fe53b432e2dc42458cede98d6f58f6037d00005f985d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Security for zerodb-rq 0.1.0

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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