Skip to main content

A simple but useful redis queue/worker

Project description

Redis simple queue

Very simple implementation from article : http://peter-hoffmann.com/2012/python-simple-queue-redis-queue.html

usage

    pip install py_redis_simple_queue

The sender

from redis import Redis

from redis_simple_queue import RedisQueue


connection = Redis() # see docs at https://docs.objectrocket.com/redis_python_examples.html


queue = RedisQueue('my_queue', connection)
queue.put('my message')

The worker

from redis import Redis

from redis_simple_queue import Worker, RedisQueue

class MyWorker(Worker):

    def run(self, msg):
        print(msg)
        # do something with message

connection = Redis()
queue = RedisQueue('my_queue', connection)
worker = MyWorker(queue)
worker.dequeue()

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

py_redis_simple_queue-0.0.4.tar.gz (2.6 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page