Skip to main content

AsyncIO version of the standard threading module

Project description

AioThreading

A Fork of aiomultiprocess built around threading for enhancing performance whenever processes can't be used

code style

After 6 years of waiting, it finally exists. This library was inspired by the amazing work of Amyreese and the other contributors of aiomultiprocess as well as the original ThreadPoolExecutor, originally my plan was to write my own threadpool that could do this and many different versions were attempted by me over the past 2 years which all of them had problems of their own such as workers failing to exit propperly and more. Eventlually I had decided to fork this branch off instead with the goal of implementing this feature that I have long wanted which was asyncio but with threads. There are some occasions where this can be useful such as running a discord bot and http server at the same time when you only have so many computer cpu cores to work with. This can come in handy when you do not need to spawn or fork in a process but at the same time you need to reduce the main loop's overall workload which can be helpful if your goal is to send multiple http requests for instance as sometimes some things can block that you didn't indend or expect to be blocked that shouldn't, aiothreading attemps solve these problems and more of them.

When to Use Aiothreading Over AioMultiprocessing

  • High task consumption over a single loop on a lower-end device

  • Networking or loading takes longer than usual in cases such as webscraping over the Tor Network

  • Your writing an application via excutable such as compiling with pyinstaller which is Notorious for not working with multiprocessing but you don't want something that will wind up acting too slow

  • When you need to run something such as a discord bot and http server over the same process examples of when you would do this would be when running a health check on the discord bot.

  • You don't want something fancy or grandiose but your still trying to find the best possible outcome.

  • Your working with a potato operating system, rasberrypi, libre-computer, etc...

  • Low CPU overall

If none of these fit your criteria I highly encourage you to use the aiomultiprocessing library, it's way faster and has smarter exiting techniques.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aiothreading-0.1.0.tar.gz (12.7 kB view details)

Uploaded Source

Built Distribution

aiothreading-0.1.0-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file aiothreading-0.1.0.tar.gz.

File metadata

  • Download URL: aiothreading-0.1.0.tar.gz
  • Upload date:
  • Size: 12.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.18

File hashes

Hashes for aiothreading-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e139097322f468cf3fc7f6b9896f3c1a77b176066946ddb678af33bf075af53d
MD5 fe33698b246a748ef9600c457c95ea11
BLAKE2b-256 11f4c2414e01b0eb2098761cd7b50e46beea092f42152c3b42ab3114e06e3788

See more details on using hashes here.

File details

Details for the file aiothreading-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for aiothreading-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8dbdf36aaf3aaeb7dd927fab34fac20d19b648858251d767369957b6835c59ec
MD5 ba2f49eb5bdb8582ed2596cb6a75d10d
BLAKE2b-256 f3418ef5a0272a165d63e0688fe1b9ceef60018d315abca873741c804fd1199b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page