Skip to content

NeilBotelho/turboAsync

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is this:

This is an attempt at building an asyncio compatible event loop that is multithreaded. I.e. you will finally be able to use asyncio and actually have it be multithreaded ! I've written a blog post explaining more about the why and how of this project.

What this isn't:

The goal here isn’t to create a production-ready or high-performance multithreaded alternative to asyncio. This is just a chance to explore the idea, share what I learn, and get a basic FastAPI server running with this multithreaded async setup.

Requirements:

The only thing you'll need is the free threaded Python 3.13 release. I recommend using pyenv to get it.

pyenv install 3.13t-dev

Then you can just install this package by running the following from the top level of the git repo:

pip install -e . 

How to try it out:

I have a couple of scripts in the tests folder that you can use to test out basic functionality as well as a basic fastapi server. Feel free to submit more interesting tests as PR's and open issues that you come across. I won't commit to fixing them, but it'll be useful to others looking at this.

  • tests/basic.py : contains a simple async function, with sleeping and asyncio.gather
  • tests/get_request.py : contains an example async GET request with httpx
  • tests/listen.py : contains sample code for listening for incoming connections in an async manner

About

A multithreaded async event loop for python

Resources

License

Stars

Watchers

Forks

Languages