The package provides extended control over threads
Project description
Better Threads
Ever wanted to pause, stop, resume or pipe data between threads? Well this module does exactly that.
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)
thread_pool.start(test_loop)
time.sleep(5)
thread_pool.pause(test_loop)
time.sleep(5)
thread_pool.resume(test_loop)
time.sleep(5)
thread_pool.stop(test_loop)
Project details
Release history Release notifications | RSS feed
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-0.3.0.tar.gz
(2.8 kB
view hashes)
Built Distribution
Close
Hashes for better_threads-0.3.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d82d77147226abb3b150e088e129a64528401566f921a21a85529c44f062e3a |
|
MD5 | 6ff110f32f7812c9dd29e1316bde958a |
|
BLAKE2b-256 | 0a3b226bc0530bd089086807f534a54bb67659c0c47b961ff85fbcf41514ff48 |