MultiThreading: Thread + Queue
Project description
Multi Threading
Example Class
import multithreading
class Demo(multithreading.MultiThread):
def task(self, task):
print(task)
Example Main
task_list = range(1, 3 + 1)
demo = Demo(task_list, threads=3)
# Start
demo.start()
Result
1
2
3
OR
demo = Demo(threads=3)
# Start threads
demo.start_threads()
# Adding task to queue
demo.add_task(1)
demo.add_task(2)
demo.add_task(3)
Result
1
2
3
Install
$ pip install multithreading
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
multithreading-0.1.3.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for multithreading-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a7b1ab389f9a636b9faf193b592e7d23f647a3b8f0a0c2600b512e5b1b68c4a |
|
MD5 | 9b5ce117c5a441265e850a30e20fa018 |
|
BLAKE2b-256 | bfba0818b2af8028bee432940ea4d7472fb188c146c01f61b3eca7569b8ec4ab |