Skip to main content

Async Redis queue for Python.

Project description

repid

PyPI version codecov Tests PyPI pyversions Code style: black

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


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)

Uploaded Source

Built Distribution

repid-0.1.1-py3-none-any.whl (7.6 kB view hashes)

Uploaded Python 3

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