python-trio / trio

Trio – a friendly Python library for async concurrency and I/O
https://trio.readthedocs.io
Other
6.23k stars 343 forks source link

Write docs on porting code to Trio #802

Open njsmith opened 5 years ago

njsmith commented 5 years ago

There should be a section in the docs explicitly addressing the question: I need a library for Trio; it doesn't exist yet; what are my options?

Maybe the best arrangement is as a set of brief case studies, looking at how different libraries have handled this, and the tradeoffs involved in each choice. (What does your library do, do you care about sync, do you care about asyncio, do you care about taking advantage of native trio stuff, etc.)

Strategies to discuss (possibly incomplete):

dd-dent commented 5 years ago

Not sure it's entirely related, but I'm itching to port stuff like this to trio...
Maybe a section with code examples from existing async/sync libraries as done via trio?
Or maybe a cookbook of sorts?

oremanj commented 5 years ago

https://github.com/python-trio/trio/issues/991#issuecomment-480405330 has an example of wrapping an "unfriendly" threaded API that might be useful as context for the sorts of porting problems people are facing.