Opened 5 years ago
Last modified 5 years ago
#9279 enhancement new
Twisted docs should have a doc explaining interop with asyncio
Reported by: | Craig Rodrigues | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | core | Keywords: | |
Cc: | Branch: | ||
Author: |
Description (last modified by )
In 9204, Alex mentioned:
I was interested in learning more about twisted/asyncio interoperability, and I had no idea where to click. I _assume_ it's somewhere in "Twisted Core", but even clicking on that yielded nothing fruitful.
We need a proper document explaining interop with asyncio.
Change History (2)
comment:1 Changed 5 years ago by
comment:2 Changed 5 years ago by
Description: | modified (diff) |
---|
Note: See
TracTickets for help on using
tickets.
There is some documentation for using asyncio here:
https://twistedmatrix.com/documents/current/core/howto/defer-intro.html#coroutines-with-async-await
Klein now has a good example for using async/await keywords:
https://klein.readthedocs.io/en/latest/examples/await.html
The main asyncioreactor is documented at https://twistedmatrix.com/documents/current/api/twisted.internet.asyncioreactor.html
The simplest example is:
Here is a fancy example which uses Python asyncio, uvloop, and twisted.web combined:
https://gist.github.com/ldjebran/4febf298232a6fd86871df25d4dc00dd