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 details)

Uploaded Source

File details

Details for the file py_redis_simple_queue-0.0.4.tar.gz.

File metadata

  • Download URL: py_redis_simple_queue-0.0.4.tar.gz
  • Upload date:
  • Size: 2.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/40.0.0 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/2.7.13

File hashes

Hashes for py_redis_simple_queue-0.0.4.tar.gz
Algorithm Hash digest
SHA256 920a8d1c77c163b00304926379c089ca93a4c24c1233fa5a61426dd35f74963e
MD5 346ece88dd56a6d0e97f32a6d66f2ea6
BLAKE2b-256 909a632088663e10622ba8daa7ed68c8464fbec84abf1e09b40bc237f84b4684

See more details on using hashes here.

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