redis-simple-mq
raw JSON → 1.1.0 verified Mon Apr 27 auth: no python
A simple message queue library built on top of Redis. Current version 1.1.0, release cadence infrequent. Requires Python >=3.8.
pip install redis-simple-mq Common errors
error ModuleNotFoundError: No module named 'redis_simple_mq' ↓
cause Installed wrong package or name mismatch.
fix
Run pip install redis-simple-mq and verify import: from redis_simple_mq import Queue
error redis.exceptions.ConnectionError: Error 111 connecting to localhost:6379. Connection refused. ↓
cause Redis server not running or wrong host/port.
fix
Ensure Redis is running: redis-server (default port 6379) or set REDIS_HOST environment variable.
Warnings
gotcha The library does not support automatic Redis connection pooling; each Queue instance creates its own connection. For high throughput, reuse the same Queue instance. ↓
fix Use a single global Queue instance or manually manage a Redis connection pool.
deprecated The method 'pop' is deprecated in favor of 'get' to align with common queue semantics. ↓
fix Use mq.get() instead of mq.pop().
Imports
- Queue wrong
from redissimplemq import Queuecorrectfrom redis_simple_mq import Queue - RedisMQ
from redis_simple_mq import RedisMQ
Quickstart
import os
from redis_simple_mq import Queue
mq = Queue(host=os.environ.get('REDIS_HOST', 'localhost'), port=6379)
# Producer
mq.put('myqueue', {'message': 'hello'})
# Consumer
message = mq.get('myqueue')
print(message)