quesadilla


Namequesadilla JSON
Version 0.5.0.post1 PyPI version JSON
download
home_pagehttps://gitlab.com/arcanery/python/quesadilla/quesadilla
SummaryAn elegant background task queue for the more civilized age
upload_time2024-09-29 02:22:03
maintainerNone
docs_urlNone
authorArtur Ciesielski
requires_python<4.0,>=3.12
licenseGPL-3.0-or-later
keywords job task queue async actor
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!-- `quesadilla` - an elegant background task queue for the more civilized age
Copyright (C) 2024 Artur Ciesielski <artur.ciesielski@gmail.com>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <https://www.gnu.org/licenses/>. -->

[![pipeline status](https://gitlab.com/arcanery/python/quesadilla/quesadilla/badges/main/pipeline.svg)](https://gitlab.com/arcanery/python/quesadilla/quesadilla/-/commits/main)
[![coverage report](https://gitlab.com/arcanery/python/quesadilla/quesadilla/badges/main/coverage.svg)](https://gitlab.com/arcanery/python/quesadilla/quesadilla/-/commits/main)
[![latest release](https://gitlab.com/arcanery/python/quesadilla/quesadilla/-/badges/release.svg)](https://gitlab.com/arcanery/python/quesadilla/quesadilla/-/releases)

# quesadilla

`quesadilla` is an elegant background task queue for the more civilized age.

## Example usage

First, install `quesadilla`: `pip install quesadilla==0.5.0`.

`tasks.py`:

```python
import logging
import random

from quesadilla.connectors.in_memory import ThreadSafeInMemoryConnector
from quesadilla.core import TaskNamespace, async_task, sync_task

logging.basicConfig(level=logging.INFO)

namespace = TaskNamespace("tasks", connector=ThreadSafeInMemoryConnector())
queue = namespace.queue("queue")


@sync_task(queue)
def simple_task(i: int) -> bool:
    return i == 0


@async_task(queue)
async def simple_atask(i: int) -> bool:
    return i == 0


# simulate someone adding jobs to the queue
# queue is preloaded with 200 tasks
for _ in range(100):
    simple_task.queue(random.choice((0, 1)))
    simple_atask.queue(random.choice((0, 1)))
```

Run with `python -m quesadilla runners listener tasks::queue`.

Exit with `SIGINT` (Ctrl + C) or `SIGTERM`.

## Roadmap

- support for retrying failed tasks
- support for cronjobs and heartbeat
- support for task priority
- support for delayed execution
- documentation
- a real-world connector! (most likely PostgreSQL with `psycopg` and `SQLAlchemy 2.0`)


            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/arcanery/python/quesadilla/quesadilla",
    "name": "quesadilla",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.12",
    "maintainer_email": null,
    "keywords": "job, task, queue, async, actor",
    "author": "Artur Ciesielski",
    "author_email": "artur.ciesielski@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/dc/4a/1810351beaaf9db56e49056c67a11b91775677d0c2d6249fc76f31a94c53/quesadilla-0.5.0.post1.tar.gz",
    "platform": null,
    "description": "<!-- `quesadilla` - an elegant background task queue for the more civilized age\nCopyright (C) 2024 Artur Ciesielski <artur.ciesielski@gmail.com>\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see <https://www.gnu.org/licenses/>. -->\n\n[![pipeline status](https://gitlab.com/arcanery/python/quesadilla/quesadilla/badges/main/pipeline.svg)](https://gitlab.com/arcanery/python/quesadilla/quesadilla/-/commits/main)\n[![coverage report](https://gitlab.com/arcanery/python/quesadilla/quesadilla/badges/main/coverage.svg)](https://gitlab.com/arcanery/python/quesadilla/quesadilla/-/commits/main)\n[![latest release](https://gitlab.com/arcanery/python/quesadilla/quesadilla/-/badges/release.svg)](https://gitlab.com/arcanery/python/quesadilla/quesadilla/-/releases)\n\n# quesadilla\n\n`quesadilla` is an elegant background task queue for the more civilized age.\n\n## Example usage\n\nFirst, install `quesadilla`: `pip install quesadilla==0.5.0`.\n\n`tasks.py`:\n\n```python\nimport logging\nimport random\n\nfrom quesadilla.connectors.in_memory import ThreadSafeInMemoryConnector\nfrom quesadilla.core import TaskNamespace, async_task, sync_task\n\nlogging.basicConfig(level=logging.INFO)\n\nnamespace = TaskNamespace(\"tasks\", connector=ThreadSafeInMemoryConnector())\nqueue = namespace.queue(\"queue\")\n\n\n@sync_task(queue)\ndef simple_task(i: int) -> bool:\n    return i == 0\n\n\n@async_task(queue)\nasync def simple_atask(i: int) -> bool:\n    return i == 0\n\n\n# simulate someone adding jobs to the queue\n# queue is preloaded with 200 tasks\nfor _ in range(100):\n    simple_task.queue(random.choice((0, 1)))\n    simple_atask.queue(random.choice((0, 1)))\n```\n\nRun with `python -m quesadilla runners listener tasks::queue`.\n\nExit with `SIGINT` (Ctrl + C) or `SIGTERM`.\n\n## Roadmap\n\n- support for retrying failed tasks\n- support for cronjobs and heartbeat\n- support for task priority\n- support for delayed execution\n- documentation\n- a real-world connector! (most likely PostgreSQL with `psycopg` and `SQLAlchemy 2.0`)\n\n",
    "bugtrack_url": null,
    "license": "GPL-3.0-or-later",
    "summary": "An elegant background task queue for the more civilized age",
    "version": "0.5.0.post1",
    "project_urls": {
        "Documentation": "https://arcanery.gitlab.io/python/quesadilla/quesadilla/",
        "Homepage": "https://gitlab.com/arcanery/python/quesadilla/quesadilla",
        "Repository": "https://gitlab.com/arcanery/python/quesadilla/quesadilla"
    },
    "split_keywords": [
        "job",
        " task",
        " queue",
        " async",
        " actor"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "79cd6509cb275e52a219a3b2b5daaca4097559bcbac293b82b276201c12b50c6",
                "md5": "ada99934f987026d1771a0e99fca44f6",
                "sha256": "bde0044e186d10ef5f214d7c5eda38829c58313a73c865eb167adb6a27bd2dcc"
            },
            "downloads": -1,
            "filename": "quesadilla-0.5.0.post1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ada99934f987026d1771a0e99fca44f6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.12",
            "size": 15424,
            "upload_time": "2024-09-29T02:22:02",
            "upload_time_iso_8601": "2024-09-29T02:22:02.220614Z",
            "url": "https://files.pythonhosted.org/packages/79/cd/6509cb275e52a219a3b2b5daaca4097559bcbac293b82b276201c12b50c6/quesadilla-0.5.0.post1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dc4a1810351beaaf9db56e49056c67a11b91775677d0c2d6249fc76f31a94c53",
                "md5": "e95391774346fe40707ba56ba4b1ed46",
                "sha256": "93705616409babda13498692676e1460d9d3019505f7ff75c5f19dc0e12b39a4"
            },
            "downloads": -1,
            "filename": "quesadilla-0.5.0.post1.tar.gz",
            "has_sig": false,
            "md5_digest": "e95391774346fe40707ba56ba4b1ed46",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.12",
            "size": 14891,
            "upload_time": "2024-09-29T02:22:03",
            "upload_time_iso_8601": "2024-09-29T02:22:03.243139Z",
            "url": "https://files.pythonhosted.org/packages/dc/4a/1810351beaaf9db56e49056c67a11b91775677d0c2d6249fc76f31a94c53/quesadilla-0.5.0.post1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-29 02:22:03",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "arcanery",
    "gitlab_project": "python",
    "lcname": "quesadilla"
}
        
Elapsed time: 0.36995s