|
|
|
|
|
by RubyPinch
3332 days ago
|
|
Well you can do all of that sync, can't you? def on_connection:
send(headers)
send(start of page)
for row in db:
send(row)
send(footer)
will have the exact same effect as what you said (not like that applies regardless, I don't think jinja outputs partial renders, since its made for flask)The performance comparison is between python managed green threads, and OS managed actual threads. You don't get any new features |
|
In real world, your web page consists more than one db (like mysql + redis + some RPC calls to microservices) queries, with async apis, you can concurrently request for all queries at once and join them all at rendering.
The async benefits can add up to a much faster responsive server.