Skip to main content

A distributed queue based on Redis

Installation

pip install redque

Example

import time
import random
import threading
import redis
import redque


def productor(redis_conn):
    other_queue = redque.Queue(redis_conn, "__test", "bp__test")

    for _ in range(100):
        other_queue.push("e_{0}".format(random.randint(1, 100)))
        time.sleep(0.1)


if __name__ == "__main__":
    pool = redis.ConnectionPool(
        host="127.0.0.1",
        port=6379,
        password="123456"
    )

    queue = redque.Queue(
        redis.Redis(connection_pool=pool),
        "__test",
        "bp__test"
    )
    queue.clear(True)

    # non-blocking
    for _ in range(100):
        queue.push(random.randint(1, 100))

    queue.process(lambda x: (print(x), True), False)

    # blocking
    t = threading.Thread(target=productor,
                        args=(redis.Redis(connection_pool=pool),))
    t.start()

    queue.process(lambda x: (print(x), True), timeout=3)

    t.join()

Release files for redque 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 redque 0.1.0
File Size Uploaded
redque-0.1.0.tar.gz 2.6 kB Details

Built distribution (wheel)

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

Total release size: 9.2 kB

Release files / redque-0.1.0.tar.gz

Download URL redque-0.1.0.tar.gz
Size 2.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1e2dac63d8453b6d5f49aa7ec3a085e6a8356ae63d05bdcbe41fbfc3276fdb16
BLAKE2b-256 checksum
How to use checksums
274c3259e7da7395d765cda5cc50dcb9718dacf7b575ca9526d9362bf8145af2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4

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

Download URL redque-0.1.0-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9398b35dab574b2300a756503f9db8418ef250ef54e9ca4940dd9439125464d3
BLAKE2b-256 checksum
How to use checksums
8d9b6162fd0fb3934c2a008d1ef58ec9e4461f03e3d1d986801e1e63591a5281
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.4

Release history Release notifications | RSS feed

This release

0.1.0 This release

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