Skip to main content

This library tries to solve my issue with 1000+ idle threads in Python 3.7 by using a backported ThreadPoolExecutor (with thread reuse) and giving threads a TTL.

There is probably no reason to use this for short-lived threads.

Usage

There are two ways to use this library, overwrite the default TheadPoolExecutor or use it directly.

To overwrite the default, do this as the first thing before any other thing your project does.

from timeoutthreadpoolexecutor import TimeoutThreadPoolExecutor
from concurrent.futures import thread
thread.ThreadPoolExecutor = TimeoutThreadPoolExecutor

or

from timeoutthreadpoolexecutor import TimeoutThreadPoolExecutor as ThreadPoolExecutor

License

Same as Python, I guess.

Release files for timeoutthreadpoolexecutor 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for timeoutthreadpoolexecutor 1.0.2
File Interpreter ABI Platform
timeoutthreadpoolexecutor-1.0.2-py3-none-any.whl Python 3 none any Details

Release files / timeoutthreadpoolexecutor-1.0.2-py3-none-any.whl

Download URL timeoutthreadpoolexecutor-1.0.2-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b92e88bcf7a70c8317a2f99f13e065578a35dbac23afdfc1aa8b648dff5c9f7e
BLAKE2b-256 checksum
How to use checksums
411d73f7c70b8ec75ef7e52e1db8bdd3f27bf46cf2c114065460350b597f2bba
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/45.1.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.7.5

Release history Release notifications | RSS feed

This release

1.0.2 This release

1 release file

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page