pip install concurrent-tool
Concurrent libraries for easy use of thread pools, process pools, and coroutines
requests must be installed to test before use,but the concurrent-tool library is not dependent
import requests
from tool import Multithreading, Multiprocess, Coroutines
def get_info(url):
data = requests.get(url)
print(data.status_code)
return data
# use multithreading
request_list = [
"http://icanhazip.com",
"https://github.com/OmkarPathak/pygorithm",
"https://www.cnblogs.com/lipijin/p/3862684.html"
]
multithreading = Multithreading(get_info, request_list, 2)
multithreading.multithreading()
# use multiprocess
multiprocess = Multiprocess(get_info, request_list, 3)
multiprocess.multiprocess()
# use coroutines
Coroutines([get_info(url) for url in request_list])
Metadata
Release files for concurrent-tool 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| concurrent_tool-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Release files / concurrent_tool-0.0.1-py3-none-any.whl
| Download URL | concurrent_tool-0.0.1-py3-none-any.whl |
|---|---|
| Size | 2.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
85115cfb8e7d7641828595b420f34f683b059d0cd4bcfdb772f1ab23ca56cbdf
|
|
BLAKE2b-256 checksum How to use checksums |
23f3e7604a00c60b378575b1dcd8e2b3dc006057838816c471d082247dd91b75
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/51.1.0.post20201221 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.6.8
|