Async Redis queue for Python.
Project description
repid
The repid
package is an async Redis queue for Python, built around aioredis
.
pip install repid
It can be easily used near to existing aioredis
instances. Integration with other packages (such as fastapi
) is quite simple too!
Usage
On producer side:
import repid
import asyncio
from aioredis import Redis
myredis = Redis(host="localhost", port=6379, db=0, decode_responses=True)
myrepid = repid.Repid(myredis)
async def main():
await myrepid.enqueue("my_first_job")
asyncio.run(main())
On consumer side:
import repid
import asyncio
from aioredis import Redis
myredis = Redis(host="localhost", port=6379, db=0, decode_responses=True)
myworker = repid.Worker(myredis)
@myworker.actor()
async def my_first_job():
return "Hello Repid!"
asyncio.run(myworker.run_forever())
It's important to specify decode_responses=True
because repid
relaies on parsed data.
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
repid-0.1.1.tar.gz
(6.6 kB
view hashes)
Built Distribution
repid-0.1.1-py3-none-any.whl
(7.6 kB
view hashes)