Anton Caceres - Better asynchronous code with Tornado and Python 3

preview_player
Показать описание
Anton Caceres - Better asynchronous code with Tornado and Python 3
[EuroPython 2015]
[23 July 2015]
[Bilbao, Euskadi, Spain]

The asyncio module introduced in Python 3.4 is a game-changer for I/O
management and event-driven network programming in Python. Aiming to
be a lower-level implementation of an asynchronous event loop, it
intends that higher level frameworks like Tornado, Twisted or Gevent
will build on top of it, taking advantage of the shared interface for
writing concurrent event-driven code across different Python
frameworks.

This talk connects theory with practice, presenting how Tornado can
run in the asyncio event loop and take advantage of the subgenerator
delegation syntax (yield from) to provide a high degree of concurrency
while keeping the simplicity of sequential code. It explains the
concept of coroutines, futures and ioloop, exposing Python 3 code for
sample web tasks. The talk completes with a basic demo of running this
code on Tornado, comparing its syntax and performance with popular
asynchronous frameworks from other languages.
Рекомендации по теме
Комментарии
Автор

Thank you for this wonderful video,
juste a small note: when you use @coroutine you can avoid finish(), this is used when you use the old @asynchronous

AlianeAbdelouahab
Автор

thank you for the presentation. Good job Anton!

alfinakhret
Автор

Great talk! was able to understand how couroutines work!

gromilla
Автор

To answer the last question about databases and async, I'm using for example:
- motor / motorengine
- tornado-redis
- momoko
- pika
...

AnthonyPerot