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.

Files for traio, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size traio-0.2.0.tar.gz (7.5 kB) File type Source Python version None Upload date Hashes View
Filename, size traio-0.2.0-py3-none-any.whl (13.2 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page