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.1.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for multithreading-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | efc68e32f91ee397a2c9d3e81c425ae478ad1412f8a6109c10e2fa52dd42a4f9 |
|
MD5 | 45f31e39713597b8cfcf1f17be435f1c |
|
BLAKE2b-256 | 2ffcfd833ae5dac9a83ffb667ff286ee35d029b21fc1e449c93ec51b46358a47 |