Redis plugin for aioworkers.
- Works on redis-py
- Queue based on RPUSH, BLPOP, LLEN, LRANGE
- ZQueue based on ZADD, ZRANGE, ZCARD, ZREM, EVAL
- TimestampZQueue based ZQueue
- Storage based on SET, GET
- HashStorage based on HSET, HGET, HDEL, HMSET, HMGET, HGETALL
- HyperLogLogStorage based on PFADD, PFMERGE, PFCOUNT
Add this to aioworkers config.yaml:
redis:
cls: aioworkers_redis.base.Connector
prefix: app
connection:
host: localhost
port: 6379
maxsize: 20
queue:
cls: aioworkers_redis.queue.Queue
connection: .redis
format: json
key: queue
You can work with redis queue like this:
await context.queue.put({'a': 1})
d = await context.queue.get()
Check code:
hatch run lint:all
Format code:
hatch run lint:fmt
Run tests:
hatch run pytest
Run tests with coverage:
hatch run cov