-
Notifications
You must be signed in to change notification settings - Fork 12
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
asyncronous tags #15
Comments
Mmm. That would be pretty hard to implement and that would be slower. At least until V8 implements generators. It would be ideal when emitting chunks of html to reduce the memory usage and provide faster responses. At this point the way to go with all template systems is to get all the async results and then pass them to the view. But I agree with you that that would be very useful. So maybe I considerer implementing it optionally (because it would be slower). |
At this time as a temp solituion I can simulate sync behavior of async functions with fibers (https://github.com/0ctave/node-sync) but it would be much much slower than native async functions support. Implementation of generators in V8 may take a lot of time (they even not realized yet iterations in harmony's Map). So I hope you will consider to implement it :) |
That would be cool but indeed would be resource consuming... :/ |
I have mostly implemented the full twig language features. I'm near to a first stable and complete release. |
Ok. So now node v0.11.2 using --harmony supports generators, and thus async linear code. |
Is it possible to add support of asyncronous tags?
for example i want to create tag "render" (like in symfony) and use it in templates like:
{% render('top_10_news_controller') %}
but controller can't immediately return data for top 10 news (for example controller gets them from database)
The text was updated successfully, but these errors were encountered: