Skip to main content

Atlas Consortia JobQ

PyPI version

Atlas Consortia JobQ is a high-performance, Redis-backed priority queue system designed for background task management.

Table of Contents

Installation

Install the package via pip:

pip install atlas-consortia-jobq

Note: Requires a running Redis instance. Refer to the Redis documentation for instructions on installing and running Redis

Quick Start

1. Initialize the Queue

from atlas_consortia_jobq import JobQueue

# Connect to your Redis instance
jq = JobQueue(
    redis_host='localhost',
    redis_port=6379,
    redis_db=0,
    redis_password=None
)

2. Enqueue a Job

Jobs require a function, an entity_id, and optional arguments.

  • reference_id: A unique identifier generated for every specific job. This is created during the enqueing process and will be returned so the job may be referenced later.

  • entity_id: The unique identifier of the resource being processed (e.g., a UUID). This prevents the same resource from being queued multiple times.

def my_task(arg1, keyword_arg="default"):
    print(f"Processing: {arg1}, {keyword_arg}")

reference_id = jq.enqueue(
    task_func=my_task,
    entity_id="unique_id_123",
    args=["value1"],
    kwargs={"keyword_arg": "value2"},
    priority=2
)

Worker Management

To process jobs, you must start worker subprocesses. This is typically done in a dedicated entry-point script.

from atlas_consortia_jobq import JobQueue

if __name__ == "__main__":
    jq = JobQueue(redis_host='localhost')
    
    # This call spawns 4 worker subprocesses
    jq.start_workers(num_workers=4)

Method Reference

enqueue(task_func, entity_id, args=None, kwargs=None, priority=1)

Adds a job to the queue.

  • If the entity_id is already queued, it updates the priority if the new priority is higher.

  • If the entity_id is currently being processed, it prevents duplicate enqueuing.

update_priority(identifier, new_priority)

Updates the priority of an existing job. The identifier can be a reference_id or an entity_id.

get_status(identifier)

Returns a dictionary containing the reference_id, position_in_queue, and priority. Here "identifier" can be either the reference_id or the entity_id.

get_queue_status()

Returns an overview of the entire queue, including total job counts and a breakdown by priority level.

Features

  • Atomic Operations: Uses Lua scripting to ensure job enqueuing and popping are race-condition free.

  • entity_id Deduplication: Prevents multiple jobs for the same entity_id from cluttering the queue.

  • Priority Support: Supports three priority levels (1=Highest, 2=Medium, 3=Lowest).

  • Automatic Cleanup: Manages metadata and "processing" states automatically upon job completion.

Metadata

Release files for atlas-consortia-jobq 0.1.8

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

Source distribution (sdist)

Source distribution for atlas-consortia-jobq 0.1.8
File Size Uploaded
atlas_consortia_jobq-0.1.8.tar.gz 12.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for atlas-consortia-jobq 0.1.8
File Interpreter ABI Platform
atlas_consortia_jobq-0.1.8-py3-none-any.whl Python 3 none any Details

Total release size: 24.3 kB

Release files / atlas_consortia_jobq-0.1.8.tar.gz

Download URL atlas_consortia_jobq-0.1.8.tar.gz
Size 12.6 kB
Tags Source
SHA-256 checksum
How to use checksums
bc229f8d1fb07dffcca5c446ddd7a15c7659266afce89d50da886a4fbb044851
BLAKE2b-256 checksum
How to use checksums
9090f200cd74528ee746c6dae37661a0046bf404a728336f0bd5cb68a40ffb95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jul 1, 2026.

Transparency log

Release files / atlas_consortia_jobq-0.1.8-py3-none-any.whl

Download URL atlas_consortia_jobq-0.1.8-py3-none-any.whl
Size 11.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f26555cd8b88a717794a21845cf56de19315868fcac4a4646eddf299a7428786
BLAKE2b-256 checksum
How to use checksums
8bbe871ac25177812623f685a90bbe8da19bc239cda5383705d8212eb3bf6eaa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jul 1, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.8 This release

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

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