Skip to content

aioworkers/aioworkers-redis

Repository files navigation

aioworkers-redis

Redis plugin for aioworkers.

Coverage Code style: ruff Code style: Mypy Documentation Status Python versions Hatch project

Features

Usage

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()

Development

Check code:

hatch run lint:all

Format code:

hatch run lint:fmt

Run tests:

hatch run pytest

Run tests with coverage:

hatch run cov