-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migration to trio
#174
Comments
Also worth considering using this: https://github.com/python-trio/trio-asyncio |
Re: Re: |
I'd recommend starting with |
Would it be possible to make py-libp2p async-library-neutral? So clients and programs can start the event loop with their own implimentations (asyncio, trio, or other), and libp2p can adjust to whatever they choose at runtime? |
it is definitely possible... the transparent route is to use something like another route is to factor the IO out of the library entirely and then we can provide "driver" libraries that consume IO events in their own way -- this is the "sans IO" approach linked here: #174 (comment) edit: i think the current aim of the maintainers is to go all in on trio, although this isn't a final position. it could also likely be the case that we switch to trio now and then down the road do a bigger refactoring a la sans io |
Given that libp2p is all about modularity, and that a library's async/io implimentation can make or break it's integration in other projects, I indeed also vote for factoring out the io in that final release |
@ShadowJonathan we are 👍 to going this direction, but we may take a bit of a pragmatic first step towards getting it working with trio first since full io abstraction is a more complex piece of work and is likely to take more thought and effort. At present this library is primarily used in trinity codebase and the two are being developed together. I suspect this is something that we'll entertain focusing on in the 6-12 month timeline. |
This issue serves as a starting point to discuss migrating from
asyncio
totrio
.trio
builds upon the insight gained from use ofasyncio
across the Python ecosystem; in particular, it provides support for a structured approach to concurrency that enables the correct construction of large asynchronous programs.A simple migration is to just replace use of
asyncio
with the use oftrio
.A more complex, but possibly more useful path is to consider how we can abstract out the use of IO in
py-libp2p
so that a client of the library can supply their own IO. Refer to this https://sans-io.readthedocs.io/ for more information on what I'm thinking here.The text was updated successfully, but these errors were encountered: