#100DaysOfWeb in Python Transcripts
Chapter: Day 50: Responder framework
Lecture: Key features
0:00 Before we start building our application
0:01 with Responder, let's talk about a couple
0:03 of the key features.
0:05 We're not going to be able to cover the majority of these things.
0:07 We're going to build a pretty simple app in this short chapter.
0:11 I want to highlight some of the other things
0:12 that Responder does for you.
0:14 You can go check it out.
0:15 Well, you'll definitely see the API.
0:17 So there's a pleasant API.
0:18 This is from Kenneth Reitz
0:20 and he's pretty good at putting together nice API's.
0:23 Things like requests are considered some
0:24 of the better API's out there.
0:27 It has class-based views
0:29 but you don't have to use inheritance.
0:31 You can just use a decorator on a class, basically.
0:34 It has a nice ASGI framework.
0:37 So these are the Async web Service Gateway Interfaces.
0:40 This is, we talked about this
0:41 when we talked about the Quart framework.
0:43 This is the essential element that allows us to use async
0:47 and await for our web view methods
0:50 and actually use asyncio to do more concurrency.
0:53 And that's one of the key foundations of Responder
0:56 is it's built on top of an ASGI
0:58 and natively and first-class supports async web view methods.
1:04 That because of that it's pretty easy for it to support WebSocket.
1:07 It also has the ability to take any other ASGI or WSGI app
1:11 and make that a sub part of the application.
1:14 So imagine there's some Flask app
1:17 and you want to make that part of your sub application.
1:20 Or you want to take a Pyramid app
1:21 and make that part of some CMS section, or who knows.
1:25 You can mount these other apps as sub routes
1:28 and sort of combine them together. That's pretty cool.
1:30 It has nice, simple f-string-like ways to declare routes.
1:34 So you don't have to do regular expressions
1:36 and stuff like that.
1:37 It has a mutable response object that's passed to each view.
1:40 So you don't have to return anything.
1:42 You just set some properties
1:43 and then it just picks those up as it goes.
1:46 One interesting feature is it has support for background tasks.
1:49 So instead of running those as part of the request
1:52 you can actually just register stuff
1:54 to run in the background
1:55 and that's actually internally done
1:56 with a ThreadPoolExecutor.
1:58 Also has support for GraphQL, OpenAPI schema generation
2:01 and documentation, and even special support
2:04 for single page web apps or SPA's.
2:06 That's quite a few cool features
2:08 so it's a really neat framework.