Registry / workflow / taskthread

taskthread

JSON →
library1.4pypypi✓ verified 83d ago

A lightweight Python module for running a repetitive task on a single dedicated thread. Currently at version 1.4, with infrequent releases.

pip install taskthread
INSTALL
IMPORT
SIG · TASKTHREAD
T
taskthread
workflowpythonv1.4
Install
2.5s avg
Import
19ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.018s · 19.3MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.5s · import 0.020s · 20MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TaskThread
from taskthread import TaskThread
The main class is always imported from 'taskthread'.

Create a TaskThread that executes my_task every 2 seconds, start it, then stop after 10 seconds.

from taskthread import TaskThread import time def my_task(): print("Task execution at", time.time()) # Run my_task every 2 seconds t = TaskThread(my_task, 2) t.start() time.sleep(10) # Let it run for a while t.stop()
Debug
Known issues
gotchaThe interval parameter is in seconds (float), not milliseconds. Passing a value like 1000 will cause a long delay.
fix
Ensure interval is in seconds (e.g., 0.5 for 500ms).
affects: All
gotchaTaskThread uses a simple while loop with sleep; if the task takes longer than the interval, they will overlap because no lock is used.
fix
Design tasks to complete quickly or add your own synchronization.
affects: All
Errors
Common errors & fixes
AttributeError: module 'taskthread' has no attribute 'TaskThread'
Incorrect import statement (e.g., 'import taskthread' then 'taskthread.TaskThread').
fix
Use 'from taskthread import TaskThread'.
TypeError: 'float' object is not callable
Passed a float as the first argument instead of a callable.
fix
Ensure first argument is a function or callable object.
Upgrade
Version history
1.4latest on PyPI · released Dec 10, 2013
Audit
Dependencies

No dependency data recorded yet.

Agent activity
31 hits · last 30 days
node
26
OpenAI (training)
1
Resources
taskthread — pip install taskthread · libregistry