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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for py_redis_simple_queue-0.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 920a8d1c77c163b00304926379c089ca93a4c24c1233fa5a61426dd35f74963e |
|
MD5 | 346ece88dd56a6d0e97f32a6d66f2ea6 |
|
BLAKE2b-256 | 909a632088663e10622ba8daa7ed68c8464fbec84abf1e09b40bc237f84b4684 |