aiomultithreading:
What is it?
aiomultithreading is
A concept for creating the Best Possible Utilization of threading, multiprocessing and asyncio combined into one executor allowing the number of tasks running in parallel to be multiplied rapidly without having to do very many setups.
Aiomultithreading is meant for handling super bulky tasks such as proxy-enumeration or networking on a very large scale. This can be costly for some uneducated programmers but luckily this tool completely changes that by making use of not just your threads, cores or task counts alone, No, All of them combined. This library completely changes the playing-field and I expect to see a few people using this for something really intense.
With the combined help of aiomultiprocessing and aiothreading it is possible to acheieve the maximum amount of tasks that can be quickly ran in parallel.
Even the default tasks per child with threading and cores will surprise you.
Even with the use of a low cpu machine when doing the math (2 processes * 4 threads * 16 tasks per thread) it makes a total of 128 tasks. Theses numbers can rapidly multiply when being used pc or device using a higher cpu count.
This library also has compatability for winloop and uvloop right out of the box.
FYI
- If your goals involved some form of brute-forcing that's offline, please note that Asyncio is not the best canidate for this. Use hashcat if your trying to grind those kinds of things out.
Usage:
Dependencies
Installing
The easiest way is to install aiomultithreading is from PyPI using pip:
pip install aiomultithreading
Running
First, import the library.
from aiomultithreading import MultiPool
import asyncio
async def sleep(i:float):
await asyncio.sleep(i)
return f"slept for {i}"
async def main():
# 2 processes and 6 threads...
async with MultiPool(2, 6) as pool:
# You can go extremely fast with even 500 of these stacked together...
x = [i for i in range(5)] * 100
print(x)
async for text in pool.map(sleep, x):
print(text)
if __name__ == "__main__":
asyncio.run(main())
TODO:
- Optimize some more important parts
Metadata
Release files for aiomultithreading 0.1.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 | Actions Reset |
|---|---|---|---|---|
| aiomultithreading-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for aiomultithreading-0.1.1-py3-none-any.whl |
Release files / aiomultithreading-0.1.1-py3-none-any.whl
| Download URL | aiomultithreading-0.1.1-py3-none-any.whl |
|---|---|
| Size | 10.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f8b40b228ecad0763500a2b25c3f01b69ebf479592592a13702cfc0e3743779d
|
|
BLAKE2b-256 checksum How to use checksums |
dd1da38475284489af70f8ec15363bd72abba624aa193df8a2c417d1ffbba4fc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.18
|
Security for aiomultithreading 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.