pgqueuer

PgQueuer is a Python library leveraging PostgreSQL for efficient job queuing.

MIT License

Downloads
2.6K
Stars
950

Bot releases are visible (Hide)

pgqueuer - v0.8.9 Latest Release

Published by janbjorge about 1 month ago

What's Changed

Full Changelog: https://github.com/janbjorge/pgqueuer/compare/v0.8.8...v0.8.9

pgqueuer - v0.8.8

Published by janbjorge about 1 month ago

What's Changed

Full Changelog: https://github.com/janbjorge/pgqueuer/compare/v0.8.7...v0.8.8

pgqueuer - v0.8.7

Published by janbjorge about 1 month ago

What's Changed

Full Changelog: https://github.com/janbjorge/pgqueuer/compare/v0.8.6...v0.8.7

pgqueuer - v0.8.6

Published by janbjorge about 1 month ago

What's Changed

Full Changelog: https://github.com/janbjorge/pgqueuer/compare/v0.8.5...v0.8.6

pgqueuer - v0.8.5

Published by janbjorge about 2 months ago

New Feature: Concurrency Limiting! 🚀

Im excited to announce Concurrency Limiting in pgqueuer, enhancing your ability to manage job processing effectively.

  • Concurrency Limiting: Controls the number of jobs that can be processed concurrently per entrypoint.

Example Usage:

from pgqueuer.qm import QueueManager
from pgqueuer.models import Job

# Setup QueueManager
qm = QueueManager()

@qm.entrypoint("data_processing", concurrency_limit=5)
async def process_data(job: Job):
    # Job processing logic
    pass

What's Changed

Full Changelog: https://github.com/janbjorge/pgqueuer/compare/v0.8.4...v0.8.5

Shutout to @colingavin for another great submission ❤️

pgqueuer - v0.8.4

Published by janbjorge about 2 months ago

🚀 New Feature: Prometheus Metrics Integration in pgqueuer!

Im thrilled to unveil a new enhancement to the pgqueuer library — Prometheus Metrics Integration! This feature brings monitoring capabilities, enabling you to track and analyze real-time performance metrics of your job queues seamlessly.

Quick Setup Using Docker:

Setting up the Prometheus metrics service is straightforward using Docker and can be done in just a few steps. Here's how:

  1. Pull the Docker Image:
    Ensure you have the latest version of the Prometheus service by pulling the image from the GitHub Container Registry:

    # Pull the latest image
    docker pull ghcr.io/janbjorge/pgq-prometheus-service:latest
    
  2. Run the Docker Container:
    Use the following command to run the service, ensuring to replace the environment variables with your specific PostgreSQL connection details:

    # Run the service
    docker run -p 8000:8000 -e PGHOST=your-postgres-host -e PGDATABASE=your-database -e PGPASSWORD=your-password -e PGUSER=your-username -e PGPORT=5432 ghcr.io/janbjorge/pgq-prometheus-service
    

    This command starts the Prometheus metrics service and makes it accessible at http://localhost:8000/metrics, ready for Prometheus to scrape.

Full Changelog: https://github.com/janbjorge/pgqueuer/compare/v0.8.3...v0.8.4

pgqueuer - v0.8.3

Published by janbjorge about 2 months ago

pgqueuer - v0.8.2

Published by janbjorge about 2 months ago

What's Changed

Full Changelog: https://github.com/janbjorge/pgqueuer/compare/v0.8.1...v0.8.2

pgqueuer - v0.8.1

Published by janbjorge about 2 months ago

What's Changed

Full Changelog: https://github.com/janbjorge/pgqueuer/compare/v0.8.0...v0.8.1

pgqueuer - v0.8.0

Published by janbjorge about 2 months ago

Breaking Change

Before using this version, it is essential to run the database schema upgrade to ensure compatibility with the new features and improvements introduced. Please execute the following command before deploying the new version:

python -m pgqueuer upgrade

This step updates the database schema, including necessary modifications for the job cancellation feature and other enhancements that are critical for the new version to function correctly.

What's Changed

New Contributors

Full Changelog: https://github.com/janbjorge/pgqueuer/compare/v0.7.2...v0.8.0

pgqueuer - v0.7.2

Published by janbjorge about 2 months ago

pgqueuer - v0.7.1

Published by janbjorge about 2 months ago

pgqueuer - v0.7.0

Published by janbjorge about 2 months ago

Change

Breaking Change

Full Changelog: https://github.com/janbjorge/pgqueuer/compare/v0.6.6...v0.7.0

pgqueuer - v0.6.6

Published by janbjorge about 2 months ago

pgqueuer - v0.6.5

Published by janbjorge about 2 months ago

pgqueuer - v0.6.4

Published by janbjorge about 2 months ago

pgqueuer - v0.6.3

Published by janbjorge about 2 months ago

What's Changed

Full Changelog: https://github.com/janbjorge/PgQueuer/compare/v0.6.2...v0.6.3

pgqueuer - v0.6.2

Published by janbjorge 2 months ago

What's Changed

Full Changelog: https://github.com/janbjorge/PgQueuer/compare/v0.6.1...v0.6.2

pgqueuer - v0.6.1

Published by janbjorge 2 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/janbjorge/PgQueuer/compare/v0.6.0...v0.6.1

pgqueuer - v0.6.0

Published by janbjorge 2 months ago

Release Notes

What's Changed

Breaking Changes

Important: Before upgrading to this version, you must run the following command:

python3 -m PgQueuer upgrade

Alternatively, you can manually update the trigger function before booting up the new version.

    CREATE OR REPLACE FUNCTION fn_pgqueuer_changed() RETURNS TRIGGER AS $$
    DECLARE
        to_emit BOOLEAN := false;  -- Flag to decide whether to emit a notification
    BEGIN
        -- Check operation type and set the emit flag accordingly
        IF TG_OP = 'UPDATE' AND OLD IS DISTINCT FROM NEW THEN
            to_emit := true;
        ELSIF TG_OP = 'DELETE' THEN
            to_emit := true;
        ELSIF TG_OP = 'INSERT' THEN
            to_emit := true;
        ELSIF TG_OP = 'TRUNCATE' THEN
            to_emit := true;
        END IF;

        -- Perform notification if the emit flag is set
        IF to_emit THEN
            PERFORM pg_notify(
                'ch_pgqueuer',
                json_build_object(
                    'channel', 'ch_pgqueuer',
                    'operation', lower(TG_OP),
                    'sent_at', NOW(),
                    'table', TG_TABLE_NAME,
                    'type', 'table_changed_event'
                )::text
            );
        END IF;

        -- Return appropriate value based on the operation
        IF TG_OP IN ('INSERT', 'UPDATE') THEN
            RETURN NEW;
        ELSIF TG_OP = 'DELETE' THEN
            RETURN OLD;
        ELSE
            RETURN NULL; -- For TRUNCATE and other non-row-specific contexts
        END IF;

    END;
    $$ LANGUAGE plpgsql;

Full Changelog: https://github.com/janbjorge/PgQueuer/compare/v0.5.7...v0.6.0