TasKue
Multi stages task queue uses Redis as a backend.
Features
- Multi stages.
- Retry on fail for a defined number of retires.
- Capture task logs.
- Task can be taged with label so it will run only on runners that has the same tag.
- Skip task if any task of the previous stages failed.
Installation
pip install taskue
Getting started
Start a runner
taskue runner start --redis-host <localhost> --redis-port <6379>
More options:
tags: Runner tags, taged tasks will run only on runners which has its tagtimeout: Runner timeout, task timeout overwrites it (default 1 hour)run_untaged_tasks: Allow runner to run untaged tasks (enabled by default).path: add the path of a module to include.
How it works
from redis import Redis
from taskue import Taskue, Task
tskue = Taskue(Redis())
# define tasks
t1 = Task()
t1.execute(print, "Hello from task 1")
t1.retries = 3 # retry up to 3 times on failure
t2 = Task()
t2.timeout = 5 # set task timeout to 5
t2.execute(print, "Hello from task 2")
t3 = Task()
t3.skip_on_failure = True # skip this task if any task of the previous stage failed
t3.execute(print, "Hello from task 3")
Execute single task
# execute single task
task_uid = tskue.run(t1)
or execute multiple tasks as a workflow
# run task t1 and task t2 in stage 1 and task t3 in stage 2
workflow_uid = tskue.run_workflow([[t1, t2], [t3]])
Hint: All the tasks in the same stage run in parallel, and each stage starts when the previous stage finish.
CLI
taskue --help
Usage: cli.py [OPTIONS] COMMAND [ARGS]...
Options:
--redis-host TEXT redis hostname
--redis-port INTEGER redis port
--help Show this message and exit.
Commands:
runner
task
workflow
commands
runner:start: start new runner
task:list: list all tasksget: get task info using its uidlogsget task logsdeletedelete task
workflowlist: list all workflowsget: get workflow info using its uidlogsget workflow logsdeletedelete workflow
To Do
- Detect dead runner and reschedule its task.
- Add more docs and examples
- Add tests
Metadata
Release files for taskue 0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| taskue-0.3.tar.gz | 7.9 kB | Without provenance | Details for taskue-0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| taskue-0.3-py3-none-any.whl | Python 3 | none | any | Details for taskue-0.3-py3-none-any.whl |
Total release size: 17.9 kB
Release files / taskue-0.3.tar.gz
| Download URL | taskue-0.3.tar.gz |
|---|---|
| Size | 7.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
51b790c84ebd0aa98473a1018462761501703747077898897b8dab39b81b9431
|
|
BLAKE2b-256 checksum How to use checksums |
b6144174f5be79a5e52319b7ef1ad87a21731997d138764e7cabe4678f713ba2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.7
|
Release files / taskue-0.3-py3-none-any.whl
| Download URL | taskue-0.3-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d5e1013aa93f8d21505b38739e77c56fe445eea61e8fc541dc2d7516ac0f454e
|
|
BLAKE2b-256 checksum How to use checksums |
ba4db396b863444ab18c32c90a5e8020164d9d09742b36115f87404ce75d10e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.7
|
Security for taskue 0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.