Skip to main content

A simple asyncio wrapper attempting to look like Trio

Project description

A simple asyncio wrapper attempting to look like Trio

Build Status Coverage Status

When going deeper and deeper with asyncio, and managing a lot of tasks in parallel, you notice that on top of having a lot to deal with to keep an eye on all your task, but you also end up always doing the same kind of boiler plate...

Traio (as Trio on asyncio) let you use asyncio with the philosophy of Trio. This is not a replacement for Trio: if you do a full Trio-like project, just switch to it! Trio is just awesome, but in some cases you get stuck with asyncio, but still want to have a code you can read and manage...

Example:

import asyncio
from traio import Nursery

async def main():

    async def fetch_url(x):
        # Do something long
        await asyncio.sleep(3)

    async with Nursery(timeout=10) as nursery:
        for i in range(10):
            nursery.start_soon(fetch_url(i))

Status

This is still alpha...

TODOS

  • write more examples
  • write more test
  • extend the API
  • put CI in place

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

traio-0.2.0.tar.gz (7.5 kB view hashes)

Uploaded Source

Built Distribution

traio-0.2.0-py3-none-any.whl (13.2 kB view hashes)

Uploaded Python 3

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