tornado - Serbipunk/notes GitHub Wiki

trouble shooting

module 'tornado.web' has no attribute 'asynchronous'

https://github.com/scrapinghub/splash/issues/887

Simply you need to uninstall nbconvert and tornado

pip uninstall tornado
pip uninstall nbconvert

After that re-install nbconvert==5.3.1 and tornado version 4.2

pip install nbconvert==5.3.1
pip install tornado==4.2

has no attribute 'async_callback'

  File "/home/bai/tool/anaconda3/lib/python3.7/site-packages/tornado/web.py", line 1489, in wrapper
    result = method(self, *args, **kwargs)
  File "/home/bai/git/work_management/example_long_conn.py", line 169, in get
    self.application.shoppingCart.register(self.async_callback(self.on_message))
AttributeError: 'StatusHandler' object has no attribute 'async_callback'

https://stackoverflow.com/a/27469666

看起来是4以后就不支持这种方式了,这本书太太太老了,估计是tornado<4才能可以。

long polling

https://gist.github.com/stevepeak/4520732