• Stars
    star
    188
  • Rank 205,563 (Top 5 %)
  • Language
    Python
  • License
    Other
  • Created about 7 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

a re-implementation of the asyncio mainloop on top of Trio
Join chatroom Documentation Status Automated test status (Linux and MacOS) Automated test status (Windows) Test coverage

trio-asyncio

trio-asyncio is a re-implementation of the asyncio mainloop on top of Trio.

Trio-Asyncio requires at least Python 3.6. It is tested on recent versions of 3.6, 3.7, 3.8, and nightly.

Rationale

Trio has native concepts of tasks and task cancellation. Asyncio is based on callbacks and chaining Futures, albeit with nicer syntax, making handling failures and timeouts fundamentally less reliable, especially in larger programs. Thus, you really want to base your async project on Trio.

On the other hand, there are quite a few asyncio-enhanced libraries. You really don't want to re-invent any wheels in your project.

Thus, being able to use asyncio libraries from Trio is useful. trio-asyncio enables you to do that and more.

Transparent vs. explicit translation

trio_asyncio does not try to magically allow calling await trio_code() from asyncio or vice versa. There are multiple reasons for this; the executive summary is that cross-domain calls can't be made to work correctly, and any such call is likely to result in an irrecoverable error. You need to keep your code's asyncio and trio domains rigidly separate.

Fortunately, this is not difficult.

Usage

Trio-Asyncio's documentation is too large for a README.

For further information, see the manual on readthedocs.

Contributing

Like Trio, trio-asyncio is licensed under both the MIT and Apache licenses. Submitting a patch or pull request implies your acceptance of these licenses.

Testing is done with pytest. Test coverage is pretty thorough; please keep it that way when adding new code.

See the Trio contributor guide for much more detail on how to get involved.

Contributors are requested to follow our code of conduct in all project spaces.

Author

Matthias Urlichs <[email protected]> originally wrote trio-asyncio. It is now maintained by the Trio project.

More Repositories

1

trio

Trio – a friendly Python library for async concurrency and I/O
Python
6,058
star
2

trustme

#1 quality TLS certs while you wait, for the discerning tester
Python
501
star
3

purerpc

Native, async Python gRPC client and server implementation supporting asyncio, uvloop, and trio
Python
217
star
4

async_generator

Making it easy to write async iterators in Python 3.5
Python
94
star
5

sniffio

Sniff out which async library your code is running under
Python
90
star
6

unasync

The async transformation code.
Python
88
star
7

hip

A new Python HTTP client for everybody
Python
79
star
8

trio-websocket

WebSocket client and server implementation for Python Trio
Python
70
star
9

trimeter

(not ready yet) A simple but powerful job scheduler for Trio programs
Python
54
star
10

pytest-trio

Pytest plugin for trio
Python
53
star
11

triopg

PostgreSQL client for Trio based on asyncpg
Python
45
star
12

outcome

Capture the outcome of Python function calls
Python
32
star
13

exceptiongroup

Python
27
star
14

trio-typing

Type hints for Trio and related projects
Python
27
star
15

sphinxcontrib-trio

Make Sphinx better at documenting Python functions and methods
Python
26
star
16

cookiecutter-trio

Quickstart template for Trio projects
Python
25
star
17

trio-talks

Talks, slides, and other similar resources for Trio
Jupyter Notebook
22
star
18

snekomatic

The code behind @trio-bot
Python
21
star
19

flake8-async

Highly opinionated linter for Trio code
Python
17
star
20

trio-amqp

Asynchronous messaging for snake people
Python
10
star
21

asyncgpio

A small library to access GPIO pins the Trio way. Linux 4.9+ only.
Python
10
star
22

hypothesis-trio

Hypothesis plugin for trio
Python
8
star
23

trzmq

Trio + ZeroMQ - vowels = trzmq
Python
5
star
24

trio-monitor

Monitor utility for trio
Python
4
star
25

trio-owfs

Access 1wire buses (via owserver)
Python
3
star
26

ahip

You're probably looking for https://github.com/python-trio/hip
Python
2
star
27

python-trio.github.io

Trio website
1
star