Threaded Task Executor
Allows functions to be called in a seperate thread and executed in FIFO order.
Possible Uses:
- For serial communication where send/recv order matters
- Run background tasks in tkinter easily, without freezing gui
- Any application where background tasks are required to be executed in order
Gettings Started:
Installing
pip install threaded-task-executor
Importing
from threaded_task_executor import Task_Queue, Task
How To Use
tasks = Task_Queue()
tasks.add_task(Task(print, args=("test 1")))
tasks.add_task(Task(print, args=("test 2")))
When this is run it should start the thread and execute the tasks in FIFO order.
Documentation:
Task(func, callback=None, task_name="", args=(), kwargs={})
- func : the function that will be called when executed
- callback : function that will be run when the task has started and finished
- callback("STARTED", task_name)
- callback("FINISHED", task_name)
- task_name : the name of the task
- args : tuple of arguments that will be given to the function
- kwargs : dict of keyword arguments that will be given to the function
Task_Queue(daemon=None)
- daemon : (True, False, None) : Whether main thread has to wait for thread to finish before stopping main thread
- add_task(new_task) : Adds a new task obj, if there is no threads running will start one
- get_current_task() : Allows for the current task that is executing to be returned
- tasks_left() : Returns the number of tasks left to be completed, includes currently executing task if any.
- add_from_func(callback, task_name) : used as a decorator which acts as add_task()
Updates:
1.1
- New decorator method that allows for adding to a Task_Queue obj
1.0
First version
Metadata
Release files for threaded-task-executor 1.1
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 |
|---|---|---|---|---|
| threaded-task-executor-1.1.tar.gz | 3.5 kB | Without provenance | Details for threaded-task-executor-1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| threaded_task_executor-1.1-py3-none-any.whl | Python 3 | none | any | Details for threaded_task_executor-1.1-py3-none-any.whl |
Total release size: 8.9 kB
Release files / threaded-task-executor-1.1.tar.gz
| Download URL | threaded-task-executor-1.1.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
888ce0989ed9ed590732794cfb99e870ddfb1693bf03ad6e1d6cb1b3661d87b5
|
|
BLAKE2b-256 checksum How to use checksums |
142c809db51a04536f5e4c6908695336c354c60a2f9e91014310122339b8b0e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.1
|
Release files / threaded_task_executor-1.1-py3-none-any.whl
| Download URL | threaded_task_executor-1.1-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0bb49c0a0b9445827db8d3571e46bd9688b9261735f41d88f8a6a2f67e9a7d8b
|
|
BLAKE2b-256 checksum How to use checksums |
f6d3e2492f6ba9e3fedba819fb6efe746b9d8c6595b4e3585b8ee15627bcd944
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.41.0 CPython/3.7.1
|
Security for threaded-task-executor 1.1
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.