Skip to main content

Kombu integration for taskiq

Project description

taskiq-kombu

taskiq-kombu is a plugin for taskiq that adds a new broker based on kombu.

The broker makes use of kombu Consumer and Producer so you can use any kombu transport as taskiq broker.

CI PyPI Python

License MyPy Ruff codecov


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-kombu

Or using uv:

uv add taskiq-kombu

Usage

An example with the broker

# example.py
import asyncio
from kombu import Connection, Queue

from taskiq_kombu import KombuBroker

broker = KombuBroker(
    connection=Connection("sqla+sqlite:///tasks.db"),
    queues=[
        Queue("my_queue", exchange="", routing_key="my_queue"),
    ],
)


@broker.task("my_task")
async def my_task(a: int, b: int) -> None:
    print("AB", a + b)


async def main():
    await broker.startup()

    await my_task.kiq(1, 2)

    await broker.shutdown()


if __name__ == "__main__":
    asyncio.run(main())

Run example

shell 1: start a worker

$ taskiq worker example:broker

shell 2: run the example script

$ python example.py

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_kombu-0.1.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

taskiq_kombu-0.1.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file taskiq_kombu-0.1.0.tar.gz.

File metadata

  • Download URL: taskiq_kombu-0.1.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for taskiq_kombu-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8aafceb8bb656c4f39455c97147d078cb0e03f38df3bac0715901c0f4a0cf4d2
MD5 3dd928b823137ad2678330a067f5cfd1
BLAKE2b-256 36eaeca12b1e8ca26d815905a5a765af7ef7ba7dc68ff4b6031caab2fbc19f0f

See more details on using hashes here.

Provenance

The following attestation bundles were made for taskiq_kombu-0.1.0.tar.gz:

Publisher: release.yml on soapun/taskiq-kombu

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file taskiq_kombu-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: taskiq_kombu-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for taskiq_kombu-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0894e2fd581a2787a68b79ae953a01a66223c91773f4758f5f2959a88b49f90f
MD5 66a47fc2263cc47a31c24f488cb3ed7b
BLAKE2b-256 c9aee6c100c9180f11601f5156ab4a0628d9c3d019bb89c7f1c007eae7cb66e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for taskiq_kombu-0.1.0-py3-none-any.whl:

Publisher: release.yml on soapun/taskiq-kombu

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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