Async Techniques and Examples in Python Transcripts
Chapter: asyncio-based web frameworks
Lecture: There is no async support for Flask

Login or purchase this course to watch this video and the rest of the course contents.
0:00 I made a statement that Flask does not operate in the async world. It does not support asyncio and there's no capabilities or way to turn that on.
0:10 We cannot have async def view method. It just doesn't work. So I want to highlight a piece of the documentation
0:18 in Flask 1.0 and then actually give you some news. If you go to docs1.0/design you'll see this block in there somewhere.
0:28 Design decisions in Flask it says ... However Flask is just not designed for large applications or Asychronous servers.
0:36 Flask wants to make it quick and easy to write a traditional web application, period. Flask will not support async, that's what it says right
0:45 in the design decisions. It's not intended for asynchronous servers. So what the heck is Flask doing in this course?
0:52 Well, two things, first of all, we're going to have something that's very, very much like Flask.
0:58 It's compatible with Flask but does support asychronous servers perfectly. Second I actually recently spoke with David Lord
1:05 who is in charge of Flask these days. I interviewed him on Talk Python, the podcast and I asked him about this. I said, it says this right in the docs.
1:13 He said, yes, but. He says that but we're intending to support asynchronous at some point. Maybe it's going to take a year, maybe even two years
1:22 but they're going to support it. So there may be a point where you're watching this video and you can just put async def on those Flask methods
1:28 and magic is going to happen but at the time of the recording, like I said, 2018 fall, this is not an option.
1:35 It does not support it and it's still a couple years out. Actually the guy that's working on the framework
1:40 that does may be collaborating with the Flask folks to make this happen natively in Flask. Okay so no async for Flask, maybe just not yet.
1:49 Anyway that's the news.

Talk Python's Mastodon Michael Kennedy's Mastodon