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
```shell
pip install py_redis_simple_queue
```
### The sender
```python
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
```python
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()
```
Very simple implementation from article : http://peter-hoffmann.com/2012/python-simple-queue-redis-queue.html
## usage
```shell
pip install py_redis_simple_queue
```
### The sender
```python
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
```python
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.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3afb0d01c259127f7aec4fe7ae623b4f9accc96988c7118f5ba4f391033800b |
|
MD5 | 7b9ee6bf0db50b21dba8c49767127c16 |
|
BLAKE2b-256 | dfed3156f2deb274ac5886f62835f1f4f1560b7f30e8071645cc7f5a0d2a7499 |