runtime-threading
This project provides a task based abstraction to threading.
Example
from runtime.threading import InterruptSignal, InterruptException
from runtime.threading.tasks import Task, ContinuationOptions
try:
signal = InterruptSignal()
i = 227
m = 0.78
def fn(task: Task[float], i: float, m: float) -> float:
task.interrupt.raise_if_signaled()
return i * m
def fn_continue(task: Task[float], preceding_task: Task[float], m: float) -> float:
return preceding_task.result * m
task1 = Task.run(fn, i, m)
task2 = task1.continue_with(ContinuationOptions.ON_COMPLETED_SUCCESSFULLY, fn_continue, m)
result1 = task1.result # -> 177.06
result2 = task2.result # -> 138.1068
task3 = Task.create(interrupt = signal.interrupt, lazy = True).plan(fn, task1.result, m)
signal.signal()
# task3 is run lazily when result property is accessed
result3 = task3.result # TaskInterruptedException
except InterruptException:
pass # won't happen since the interrupt is never signaled
Full documentation
Metadata
Release files for runtime-threading 0.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 | |
|---|---|---|---|
| runtime_threading-0.0.3.tar.gz | 37.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| runtime_threading-0.0.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 91.7 kB
Release files / runtime_threading-0.0.3.tar.gz
| Download URL | runtime_threading-0.0.3.tar.gz |
|---|---|
| Size | 37.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
37164680bf556179c3dd25c9caa36690e6af0bd523b1025a3d87ee26e5af144b
|
|
BLAKE2b-256 checksum How to use checksums |
b50bc68528da595cbc67829467fe0b674dd54dce78d81d364966e0b4263650fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 26, 2026.
Transparency logRelease files / runtime_threading-0.0.3-py3-none-any.whl
| Download URL | runtime_threading-0.0.3-py3-none-any.whl |
|---|---|
| Size | 54.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
240262875c08d0b02c082bcfaa67df40b9e60b2083bebfd8e9596e4f09d0da9f
|
|
BLAKE2b-256 checksum How to use checksums |
0b013405c7b598a740bacadcedbd8a8a224a36d4373863c875cdbcf7eec7c56f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 26, 2026.
Transparency log