Anyio: all you need for async programming stuff

A woman trying to eat and read at the same time
Photo by The Creative Exchange on Unsplash

Foreword

AnyIO is an asynchronous networking and concurrency library that works on top of either asyncio or trio. It implements trio-like structured concurrency (SC) on top of asyncio, and works in harmony with the native SC of trio itself.

Installation

pip install anyio
# if you want to test the trio backend
pip install anyio[trio]
poetry add anyio
# if you want to test the trio backend
poetry add anyio[trio]

Usage

openssl req -x509 -newkey rsa:2048 -subj '/CN=localhost' -keyout key.pem -out cert.pem -nodes -days 365

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store