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.6.tar.gz
(4.1 kB
view hashes)
Built Distribution
Close
Hashes for multithreading-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f78740b37bd63e2fb5bb4032cdbff4d751826b0f8b410b7b41797e6413f9c036 |
|
MD5 | 1e3f5e4603ac89d4d4ad955160f4da53 |
|
BLAKE2b-256 | 3be8522e6f58c8372379e781442417e007598942cc9d145791d427e9af9c1198 |