Skip to main content

Redis integration for taskiq

Project description

TaskIQ-Redis

Taskiq-redis is a plugin for taskiq that adds a new broker and result backend based on redis.

Installation

To use this project you must have installed core taskiq library:

pip install taskiq

This project can be installed using pip:

pip install taskiq-redis

Usage

Let's see the example with the redis broker and redis async result:

import asyncio

from taskiq_redis.redis_broker import RedisBroker
from taskiq_redis.redis_backend import RedisAsyncResultBackend


redis_async_result = RedisAsyncResultBackend(
    url="redis://localhost:6379",
)

broker = RedisBroker(
    url="redis://localhost:6379",
    result_backend=redis_async_result,
)


@broker.task
async def best_task_ever() -> None:
    """Solve all problems in the world."""
    await asyncio.sleep(5.5)
    print("All problems are solved!")


async def main():
    task = await my_async_task.kiq()
    print(await task.get_result())


asyncio.run(main())

RedisBroker configuration

RedisBroker parameters:

  • url - url to redis.
  • task_id_generator - custom task_id genertaor.
  • result_backend - custom result backend.
  • queue_name - name of the pub/sub channel in redis.
  • max_connection_pool_size - maximum number of connections in pool.

RedisAsyncResultBackend configuration

RedisAsyncResultBackend parameters:

  • url - url to redis.

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

taskiq-redis-0.0.3.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

taskiq_redis-0.0.3-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file taskiq-redis-0.0.3.tar.gz.

File metadata

  • Download URL: taskiq-redis-0.0.3.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.15 CPython/3.9.13 Linux/5.15.0-1017-azure

File hashes

Hashes for taskiq-redis-0.0.3.tar.gz
Algorithm Hash digest
SHA256 26dbba114979e448d6694e62fd4add3233169954f004836d5d870e21974dcb7a
MD5 f908a175a423591482486f8c5514d304
BLAKE2b-256 292864b231ccc5d0d7b68ae4adaf0e5cdd14c20cbd8db2206ec2daf8244827cf

See more details on using hashes here.

File details

Details for the file taskiq_redis-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: taskiq_redis-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.15 CPython/3.9.13 Linux/5.15.0-1017-azure

File hashes

Hashes for taskiq_redis-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 70037745d54e1fdc0de811bdf9f1a0911717ae221131ae7b2963a8790bedb10c
MD5 369e88e19c5bef62a5d8346b0f2c640b
BLAKE2b-256 fbe5c3ebbe722fd8a1cae4911892182e0f0828d2beb5482d7024fff1a5ca628c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page