-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support async rendering #333
Comments
Currently, it looks like the only way to use the async functionality is like this:
|
Given that passing enable_async breaks the existing functions, maybe a good way to handle backwards compatibility is just to switch the functions when enable_async is passed by the user. e.g.
Or, something like that. Then all the user has to do is add |
@asvetlov I'm happy to work on this PR. Any thoughts on the correct way to implement it? Does my last comment seem reasonable? |
I think we need separate functions for async mode. If you are willing to work on it -- please go ahead |
template()
andrender_template()
should be async functions, or for backwards compatibility new async versions of the functions should be added.They should call
jinja2.Template.render_async()
, which also requiresenable_async
in the environment setup.See:
https://jinja.palletsprojects.com/en/2.11.x/api/#jinja2.Environment
https://jinja.palletsprojects.com/en/2.11.x/api/#jinja2.Template.render_async
https://jinja.palletsprojects.com/en/2.11.x/api/#async-support
The text was updated successfully, but these errors were encountered: