Skip to main content

A package that provides extended control over threads

Project description

Better Threads

A wrapper over threads that provides extended control. The module supports pausing, terminating and putting threads to sleep. The module also provides some additional tools to Pipe data between threads and a thread pool to keep track of threads.

Key features

  • Pipe data between threads
  • Pause, Resume and Stop threads
  • Simple

Installing

Python 3.7 or higher is required

pip install better-threads

Quick example

More exmples https://github.com/ItsYasiru/Better-Threads/tree/master/examples

import time
from BetterThreads import ThreadPool

thread_pool = ThreadPool()


@thread_pool.thread()
def test_loop():
    print("Loop running!")
    time.sleep(1)


test_loop.start(test_loop)
time.sleep(5)
test_loop.terminate(test_loop)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

better-threads-2.0.7.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

better_threads-2.0.7-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file better-threads-2.0.7.tar.gz.

File metadata

  • Download URL: better-threads-2.0.7.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for better-threads-2.0.7.tar.gz
Algorithm Hash digest
SHA256 982d1432bf6e6faed2cb6c8fea253e6d995fa89fe0734da126d3cf71894c3345
MD5 dd816c54ec556924733e0bcb55571f05
BLAKE2b-256 ceda23b688abeaf0cd45f1dfc17cd057d0b921cf426516752f08b92cdf3ecd67

See more details on using hashes here.

File details

Details for the file better_threads-2.0.7-py3-none-any.whl.

File metadata

  • Download URL: better_threads-2.0.7-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10

File hashes

Hashes for better_threads-2.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 a42a617f7335390a2e343f86642b6718aefe209cdcbb7f4f644a5efa801cb67f
MD5 4009fa530831f286f44ef6085037c701
BLAKE2b-256 7de97c0c6dfb95c6e4d41309ea3be5a431b6b78ed75b163f0bad5e50ec073553

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page