Easily create and run tasks (=function calls) with almost seamless transition between Local development and Distributed deployment.
Project description
a-task-queue
Easily create and run tasks (=function calls) with almost seamless transition between Local development and Distributed deployment."
Usage
from ataskq import TaskQ, Task, targs
from ataskq.tasks_utils import hello_world, dummy_args_task
def hello_world():
print("hello world")
def task_with_args(*args, **kwargs):
print(f"task_with_args args: {args}, kwargs: {kwargs}")
# create job
tr = TaskQ().create_job()
# add tasks
# add tasks (functions to run)
tr.add_tasks(
[
Task(entrypoint=hello_world),
Task(entrypoint=task_with_args, targs=targs("arg0", "arg1", kwarg1=10, kwarg2="this is kwarg2")),
]
)
# run the tasks
tr.run() # to run in parallel add concurrency=N
more example can be found here
Contributer
to setup project run
./contrib/setup.sh
vs code
to get nominal vscode settings run
./contrib/.vscode/init.sh
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ataskq-0.6.5.tar.gz.
File metadata
- Download URL: ataskq-0.6.5.tar.gz
- Upload date:
- Size: 64.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d779245c00fb4bee524b4db0adcb2fd0f346a3ecce66654df6529e95ed0906c
|
|
| MD5 |
8bed2854aae752aeafbd017ed67d264d
|
|
| BLAKE2b-256 |
8e8e83d2a8a1ff2385ffcf9d99d44b89890f98749396fd6961fc4f9fb7aa1c2e
|
File details
Details for the file ataskq-0.6.5-py3-none-any.whl.
File metadata
- Download URL: ataskq-0.6.5-py3-none-any.whl
- Upload date:
- Size: 76.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7da88ea902dab1ce63e150ae3485fc9a2308224597874ebec909813dfe5b77d
|
|
| MD5 |
d4b41718aea9bbc7b244f82b102b8a35
|
|
| BLAKE2b-256 |
afade77a87325b2327fcb1f378f3926befca28ea5b7c640dcf567728757a575c
|