# Kolona
A minimalistic in-memory async Python Task queue.
## Install
`pip install kolona`
## Features
- Retry tasks
- Multiple workers
- In-memor only (no 3rd party message brokers required)
- Python native using asyncio
- Statically typed
## Example
```py
import asyncio
from kolona import task, Workers
# create a queue
QUEUE = asyncio.Queue()
@task(queue=QUEUE, max_retries=2)
async def purchase_listener(*args):
print(f"purchase_listener -> args: {args}")
@task(queue=QUEUE, max_retries=3)
async def account_checker(*args):
print(f"account_checker doing checking")
async def main():
# queue 1 account_checker task
await account_checker.enqueue()
# queue 3 purchase_listener tasks, pass an argument into it
for x in range(3):
print(f"Queueing: task-{x}")
await purchase_listener.enqueue(f"task-{x}")
# start 3 workers
workers = Workers(queue=QUEUE, name="worker", count=3)
# block on workers
await asyncio.gather(*workers.get())
if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
```
Raw data
{
"_id": null,
"home_page": "https://github.com/roks0n/kolona/",
"name": "kolona",
"maintainer": "roks0n",
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": "queue, task queue, memory",
"author": "roks0n",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/e5/9d/0319a5b12d62fde1fc5883d03779f0679be2729b1d7ed23b2b040f404816/kolona-0.2.1.tar.gz",
"platform": null,
"description": "# Kolona\n\nA minimalistic in-memory async Python Task queue.\n\n## Install\n\n`pip install kolona`\n\n## Features\n\n- Retry tasks\n- Multiple workers\n- In-memor only (no 3rd party message brokers required)\n- Python native using asyncio\n- Statically typed\n\n## Example\n\n```py\nimport asyncio\n\nfrom kolona import task, Workers\n\n# create a queue\nQUEUE = asyncio.Queue()\n\n\n@task(queue=QUEUE, max_retries=2)\nasync def purchase_listener(*args):\n print(f\"purchase_listener -> args: {args}\")\n\n\n@task(queue=QUEUE, max_retries=3)\nasync def account_checker(*args):\n print(f\"account_checker doing checking\")\n\n\nasync def main():\n # queue 1 account_checker task\n await account_checker.enqueue()\n\n # queue 3 purchase_listener tasks, pass an argument into it\n for x in range(3):\n print(f\"Queueing: task-{x}\")\n await purchase_listener.enqueue(f\"task-{x}\")\n\n # start 3 workers\n workers = Workers(queue=QUEUE, name=\"worker\", count=3)\n\n # block on workers\n await asyncio.gather(*workers.get())\n\n\nif __name__ == \"__main__\":\n loop = asyncio.get_event_loop()\n loop.run_until_complete(main())\n```\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "A minimalistic in-memory async Python Task queue",
"version": "0.2.1",
"project_urls": {
"Homepage": "https://github.com/roks0n/kolona/"
},
"split_keywords": [
"queue",
" task queue",
" memory"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "4ad63e48d364434c0ae3bc58147cb366e69cbdc75d30bd6871f497f5ce75c114",
"md5": "2ee29ff054af628f61fc1e92715b1116",
"sha256": "b907f53e8037a38b28e2c474a9c07bfefabc3d4df0546d1f44e3244391ff0e45"
},
"downloads": -1,
"filename": "kolona-0.2.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "2ee29ff054af628f61fc1e92715b1116",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 6056,
"upload_time": "2024-07-22T14:19:21",
"upload_time_iso_8601": "2024-07-22T14:19:21.985772Z",
"url": "https://files.pythonhosted.org/packages/4a/d6/3e48d364434c0ae3bc58147cb366e69cbdc75d30bd6871f497f5ce75c114/kolona-0.2.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e59d0319a5b12d62fde1fc5883d03779f0679be2729b1d7ed23b2b040f404816",
"md5": "4c41b2676b8565dd67fec07ff7a4719c",
"sha256": "4de5cb6370a9cd257bb57ca5a804471d99004c8c4b7cb220b8fa20dd8ae7e48d"
},
"downloads": -1,
"filename": "kolona-0.2.1.tar.gz",
"has_sig": false,
"md5_digest": "4c41b2676b8565dd67fec07ff7a4719c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 6850,
"upload_time": "2024-07-22T14:19:24",
"upload_time_iso_8601": "2024-07-22T14:19:24.140613Z",
"url": "https://files.pythonhosted.org/packages/e5/9d/0319a5b12d62fde1fc5883d03779f0679be2729b1d7ed23b2b040f404816/kolona-0.2.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-07-22 14:19:24",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "roks0n",
"github_project": "kolona",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "backports-tarfile",
"specs": [
[
"==",
"1.2.0"
]
]
},
{
"name": "black",
"specs": [
[
"==",
"24.4.2"
]
]
},
{
"name": "build",
"specs": [
[
"==",
"1.2.1"
]
]
},
{
"name": "certifi",
"specs": [
[
"==",
"2024.7.4"
]
]
},
{
"name": "cffi",
"specs": [
[
"==",
"1.16.0"
]
]
},
{
"name": "charset-normalizer",
"specs": [
[
"==",
"3.3.2"
]
]
},
{
"name": "click",
"specs": [
[
"==",
"8.1.7"
]
]
},
{
"name": "coverage",
"specs": [
[
"==",
"7.6.0"
]
]
},
{
"name": "cryptography",
"specs": [
[
"==",
"43.0.0"
]
]
},
{
"name": "docutils",
"specs": [
[
"==",
"0.20.1"
]
]
},
{
"name": "exceptiongroup",
"specs": [
[
"==",
"1.2.2"
]
]
},
{
"name": "flake8",
"specs": [
[
"==",
"7.1.0"
]
]
},
{
"name": "flake8-import-order",
"specs": [
[
"==",
"0.18.2"
]
]
},
{
"name": "flake8-print",
"specs": [
[
"==",
"5.0.0"
]
]
},
{
"name": "flake8-quotes",
"specs": [
[
"==",
"3.4.0"
]
]
},
{
"name": "idna",
"specs": [
[
"==",
"3.7"
]
]
},
{
"name": "importlib-metadata",
"specs": [
[
"==",
"8.0.0"
]
]
},
{
"name": "importlib-resources",
"specs": [
[
"==",
"6.4.0"
]
]
},
{
"name": "iniconfig",
"specs": [
[
"==",
"2.0.0"
]
]
},
{
"name": "isort",
"specs": [
[
"==",
"5.13.2"
]
]
},
{
"name": "jaraco-classes",
"specs": [
[
"==",
"3.4.0"
]
]
},
{
"name": "jaraco-context",
"specs": [
[
"==",
"5.3.0"
]
]
},
{
"name": "jaraco-functools",
"specs": [
[
"==",
"4.0.1"
]
]
},
{
"name": "jeepney",
"specs": [
[
"==",
"0.8.0"
]
]
},
{
"name": "keyring",
"specs": [
[
"==",
"25.2.1"
]
]
},
{
"name": "markdown-it-py",
"specs": [
[
"==",
"3.0.0"
]
]
},
{
"name": "mccabe",
"specs": [
[
"==",
"0.7.0"
]
]
},
{
"name": "mdurl",
"specs": [
[
"==",
"0.1.2"
]
]
},
{
"name": "more-itertools",
"specs": [
[
"==",
"10.3.0"
]
]
},
{
"name": "mypy",
"specs": [
[
"==",
"1.11.0"
]
]
},
{
"name": "mypy-extensions",
"specs": [
[
"==",
"1.0.0"
]
]
},
{
"name": "nh3",
"specs": [
[
"==",
"0.2.18"
]
]
},
{
"name": "packaging",
"specs": [
[
"==",
"24.1"
]
]
},
{
"name": "pathspec",
"specs": [
[
"==",
"0.12.1"
]
]
},
{
"name": "pip-tools",
"specs": [
[
"==",
"7.4.1"
]
]
},
{
"name": "pkginfo",
"specs": [
[
"==",
"1.10.0"
]
]
},
{
"name": "platformdirs",
"specs": [
[
"==",
"4.2.2"
]
]
},
{
"name": "pluggy",
"specs": [
[
"==",
"1.5.0"
]
]
},
{
"name": "pycodestyle",
"specs": [
[
"==",
"2.12.0"
]
]
},
{
"name": "pycparser",
"specs": [
[
"==",
"2.22"
]
]
},
{
"name": "pyflakes",
"specs": [
[
"==",
"3.2.0"
]
]
},
{
"name": "pygments",
"specs": [
[
"==",
"2.18.0"
]
]
},
{
"name": "pyproject-hooks",
"specs": [
[
"==",
"1.1.0"
]
]
},
{
"name": "pytest",
"specs": [
[
"==",
"8.3.1"
]
]
},
{
"name": "pytest-asyncio",
"specs": [
[
"==",
"0.23.8"
]
]
},
{
"name": "pytest-cov",
"specs": [
[
"==",
"5.0.0"
]
]
},
{
"name": "pytest-mock",
"specs": [
[
"==",
"3.14.0"
]
]
},
{
"name": "readme-renderer",
"specs": [
[
"==",
"43.0"
]
]
},
{
"name": "requests",
"specs": [
[
"==",
"2.32.3"
]
]
},
{
"name": "requests-toolbelt",
"specs": [
[
"==",
"1.0.0"
]
]
},
{
"name": "rfc3986",
"specs": [
[
"==",
"2.0.0"
]
]
},
{
"name": "rich",
"specs": [
[
"==",
"13.7.1"
]
]
},
{
"name": "secretstorage",
"specs": [
[
"==",
"3.3.3"
]
]
},
{
"name": "tomli",
"specs": [
[
"==",
"2.0.1"
]
]
},
{
"name": "twine",
"specs": [
[
"==",
"5.1.1"
]
]
},
{
"name": "types-docutils",
"specs": [
[
"==",
"0.21.0.20240711"
]
]
},
{
"name": "types-setuptools",
"specs": [
[
"==",
"71.0.0.20240722"
]
]
},
{
"name": "typing-extensions",
"specs": [
[
"==",
"4.12.2"
]
]
},
{
"name": "urllib3",
"specs": [
[
"==",
"2.2.2"
]
]
},
{
"name": "wheel",
"specs": [
[
"==",
"0.43.0"
]
]
},
{
"name": "zipp",
"specs": [
[
"==",
"3.19.2"
]
]
}
],
"lcname": "kolona"
}