question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Move from tornado.gen to native coroutines ?

See original GitHub issue

tornado docs for tornado.gen say:

The “decorator and generator” approach in this module is a precursor to native coroutines (using async def and await) which were introduced in Python 3.5. Applications that do not require compatibility with older versions of Python should use native coroutines instead

With the dropping of support for python<3.5, are we going to move to native coroutines and asyncio?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
mattpapcommented, Oct 23, 2019

We already upgraded the code base in https://github.com/bokeh/bokeh/tree/bryanv/async. The problem currently is with updating tests, as described in https://github.com/bokeh/bokeh/issues/9098#issuecomment-513501421. Help with that would be very welcome.

0reactions
zhammercommented, Oct 23, 2019

btw (just randomly stumbled upon this on a google search) but i made a codemod for the coroutine -> async upgrade: https://github.com/zhammer/tornado-async-transformer. happy to try running that over some code here when ready to upgrade

Read more comments on GitHub >

github_iconTop Results From Across the Web

Coroutines — Tornado 6.2 documentation
Use tornado.gen.multi to do this in native coroutines. ... it is important to call coroutines in the right way, or you may have...
Read more >
migrate @gen.coroutine AsyncHTTPClient and Motor to native ...
I'm working with latests Tornadoweb 4.4.1 and python 3.5 and motor '0.6.2'. I'm intensively use tornado.curl_httpclient.CurlAsyncHTTPClient and Motor Mondodb ...
Read more >
Coroutines — Tornado 4.5.dev1 documentation
Coroutines ¶. Coroutines are the recommended way to write asynchronous code in Tornado. Coroutines use the Python yield keyword to suspend and resume ......
Read more >
tornado.gen — Simplify asynchronous code
pauses the coroutine until both future1 and future2 return, and then restarts the coroutine with the results of both futures. If either future...
Read more >
Advantages of Tornado's coroutines compared to native ...
Starting in Tornado 4.3, you can use them in place of yield-based coroutines. Simply use async def foo() in place of a function...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found