Metadata-Version: 2.2
Name: rythreadpool
Version: 1.0.0
Summary: Multi-threading library
Author: ryzeon-dev
Project-URL: Homepage, https://github.com/ryzeon-dev/rythreadpool
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE

# ThreadPool library
- Multi-threading library 
- Allows to limit the number of threads to a fixed number

## Install
```
pip install rythreapool
```

## Usage
- import the library
```python
import threadpool
```
- create a new ThreadPool, giving as argument the number of desidred parallel threads
  - it is suggested to never exceed the number of physical threads that your processor has
```python
pool = threadpool.ThreadPool(16)
```
- now it is possible to run multiple functions or tasks 
```python
pool.execute(fn=myTask, args=())
```
- to check if the threadpool is busy, use the following function
  - returns `True` if the pool is working, otherwise returns `False`
```python
pool.isWorking()
```

### Notes
1. remember that, if a task implements active waiting, it will keep its thread busy until the end of execution
2. once reaced the limit of parallel threads, all the following tasks will have to wait for a thread to become free
