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

```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


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.3.tar.gz (2.7 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for py_redis_simple_queue-0.0.3.tar.gz
Algorithm Hash digest
SHA256 e3afb0d01c259127f7aec4fe7ae623b4f9accc96988c7118f5ba4f391033800b
MD5 7b9ee6bf0db50b21dba8c49767127c16
BLAKE2b-256 dfed3156f2deb274ac5886f62835f1f4f1560b7f30e8071645cc7f5a0d2a7499

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