Get the latest tech news

Tinyio: A tiny (~200 line) event loop for Python


Ever used asyncio and wished you hadn't? A tiny (~200 lines) event loop for Python. - patrick-kidger/tinyio

tinyio is a dead-simple event loop for Python, born out of my frustration with trying to get robust error handling with asyncio. This is an alternative for the simple use-cases, where you just need an event loop, and want to crash the whole thing if anything goes wrong. Synchronous functions can be ran in threads using tinyio.run_in_thread(fn, *args, **kwargs), which returns a coroutine you can yield on:

Get the Android app

Or read this on Hacker News

Read more on:

Photo of line

line

Photo of python

python

Photo of event loop

event loop

Related news:

News photo

Linux Kernel Could Soon Expose Every Line AI Helps Write

News photo

Why MIT switched from Scheme to Python (2009)

News photo

Superfunctions: A universal solution against sync/async fragmentation in Python