taskiq-kombu


Nametaskiq-kombu JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryKombu integration for taskiq
upload_time2025-08-16 17:07:53
maintainerNone
docs_urlNone
authorAlex Kondratev
requires_python>=3.9
licenseNone
keywords taskiq tasks distributed async kombu
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # taskiq-kombu

taskiq-kombu is a plugin for taskiq that adds a new broker based on [kombu](https://github.com/celery/kombu).

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

[![CI](https://github.com/soapun/taskiq-kombu/actions/workflows/ci.yml/badge.svg)](https://github.com/soapun/taskiq-kombu/actions/workflows/ci.yml) [![PyPI](https://badge.fury.io/py/taskiq-kombu.svg)](https://badge.fury.io/py/taskiq-kombu) [![Python](https://img.shields.io/pypi/pyversions/taskiq-kombu.svg)](https://pypi.org/project/taskiq-kombu/)

[![License](https://img.shields.io/pypi/l/taskiq-kombu.svg)](https://github.com/soapun/taskiq-kombu/blob/main/LICENSE) [![MyPy](https://img.shields.io/badge/type_checked-mypy-informational.svg)](https://mypy.readthedocs.io/en/stable/introduction.html) [![Ruff](https://img.shields.io/badge/style-ruff-blue?logo=ruff&logoColor=white)](https://github.com/astral-sh/ruff) [![codecov](https://codecov.io/github/soapun/taskiq-kombu/graph/badge.svg?token=VQHDHT5LIM)](https://codecov.io/github/soapun/taskiq-kombu)


---

## Installation

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

```bash
pip install taskiq
```

This project can be installed using pip:

```bash
pip install taskiq-kombu
```

Or using uv:

```
uv add taskiq-kombu
```

## Usage

An example with the broker

```python
# 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**

```sh
$ taskiq worker example:broker
```

**shell 2: run the example script**

```sh
$ python example.py
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "taskiq-kombu",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "taskiq, tasks, distributed, async, kombu",
    "author": "Alex Kondratev",
    "author_email": "Alex Kondratev <soapun@ya.ru>",
    "download_url": "https://files.pythonhosted.org/packages/36/ea/eca12b1e8ca26d815905a5a765af7ef7ba7dc68ff4b6031caab2fbc19f0f/taskiq_kombu-0.1.0.tar.gz",
    "platform": null,
    "description": "# taskiq-kombu\n\ntaskiq-kombu is a plugin for taskiq that adds a new broker based on [kombu](https://github.com/celery/kombu).\n\nThe broker makes use of kombu `Consumer` and `Producer` so you can use any kombu transport as taskiq broker.\n\n[![CI](https://github.com/soapun/taskiq-kombu/actions/workflows/ci.yml/badge.svg)](https://github.com/soapun/taskiq-kombu/actions/workflows/ci.yml) [![PyPI](https://badge.fury.io/py/taskiq-kombu.svg)](https://badge.fury.io/py/taskiq-kombu) [![Python](https://img.shields.io/pypi/pyversions/taskiq-kombu.svg)](https://pypi.org/project/taskiq-kombu/)\n\n[![License](https://img.shields.io/pypi/l/taskiq-kombu.svg)](https://github.com/soapun/taskiq-kombu/blob/main/LICENSE) [![MyPy](https://img.shields.io/badge/type_checked-mypy-informational.svg)](https://mypy.readthedocs.io/en/stable/introduction.html) [![Ruff](https://img.shields.io/badge/style-ruff-blue?logo=ruff&logoColor=white)](https://github.com/astral-sh/ruff) [![codecov](https://codecov.io/github/soapun/taskiq-kombu/graph/badge.svg?token=VQHDHT5LIM)](https://codecov.io/github/soapun/taskiq-kombu)\n\n\n---\n\n## Installation\n\nTo use this project you must have installed core taskiq library:\n\n```bash\npip install taskiq\n```\n\nThis project can be installed using pip:\n\n```bash\npip install taskiq-kombu\n```\n\nOr using uv:\n\n```\nuv add taskiq-kombu\n```\n\n## Usage\n\nAn example with the broker\n\n```python\n# example.py\nimport asyncio\nfrom kombu import Connection, Queue\n\nfrom taskiq_kombu import KombuBroker\n\nbroker = KombuBroker(\n    connection=Connection(\"sqla+sqlite:///tasks.db\"),\n    queues=[\n        Queue(\"my_queue\", exchange=\"\", routing_key=\"my_queue\"),\n    ],\n)\n\n\n@broker.task(\"my_task\")\nasync def my_task(a: int, b: int) -> None:\n    print(\"AB\", a + b)\n\n\nasync def main():\n    await broker.startup()\n\n    await my_task.kiq(1, 2)\n\n    await broker.shutdown()\n\n\nif __name__ == \"__main__\":\n    asyncio.run(main())\n```\n\n### Run example\n\n**shell 1: start a worker**\n\n```sh\n$ taskiq worker example:broker\n```\n\n**shell 2: run the example script**\n\n```sh\n$ python example.py\n```\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Kombu integration for taskiq",
    "version": "0.1.0",
    "project_urls": {
        "Repository": "https://github.com/soapun/taskiq-kombu"
    },
    "split_keywords": [
        "taskiq",
        " tasks",
        " distributed",
        " async",
        " kombu"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c9aee6c100c9180f11601f5156ab4a0628d9c3d019bb89c7f1c007eae7cb66e8",
                "md5": "66a47fc2263cc47a31c24f488cb3ed7b",
                "sha256": "0894e2fd581a2787a68b79ae953a01a66223c91773f4758f5f2959a88b49f90f"
            },
            "downloads": -1,
            "filename": "taskiq_kombu-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "66a47fc2263cc47a31c24f488cb3ed7b",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 4021,
            "upload_time": "2025-08-16T17:07:52",
            "upload_time_iso_8601": "2025-08-16T17:07:52.847197Z",
            "url": "https://files.pythonhosted.org/packages/c9/ae/e6c100c9180f11601f5156ab4a0628d9c3d019bb89c7f1c007eae7cb66e8/taskiq_kombu-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "36eaeca12b1e8ca26d815905a5a765af7ef7ba7dc68ff4b6031caab2fbc19f0f",
                "md5": "3dd928b823137ad2678330a067f5cfd1",
                "sha256": "8aafceb8bb656c4f39455c97147d078cb0e03f38df3bac0715901c0f4a0cf4d2"
            },
            "downloads": -1,
            "filename": "taskiq_kombu-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "3dd928b823137ad2678330a067f5cfd1",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 3488,
            "upload_time": "2025-08-16T17:07:53",
            "upload_time_iso_8601": "2025-08-16T17:07:53.939171Z",
            "url": "https://files.pythonhosted.org/packages/36/ea/eca12b1e8ca26d815905a5a765af7ef7ba7dc68ff4b6031caab2fbc19f0f/taskiq_kombu-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-16 17:07:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "soapun",
    "github_project": "taskiq-kombu",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "taskiq-kombu"
}
        
Elapsed time: 0.48000s