Skip to content
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

Conditional execution of custom async tags #374

Open
fabien opened this issue Feb 18, 2015 · 3 comments
Open

Conditional execution of custom async tags #374

fabien opened this issue Feb 18, 2015 · 3 comments
Labels

Comments

@fabien
Copy link
Contributor

fabien commented Feb 18, 2015

Because the captured output will always be parsed and executed, it is currently impossible to implement a scenario where the async will only execute when required. Take for example a {% cache %} tag that would contain & capture async tags like {% fetch %}. It's currently impossible to return cached content, without already running fetch, and thus, defeating the purpose.

@jlongster
Copy link
Contributor

I don't understand what you mean exactly, are tags running inside if blocks when they shouldn't?

I see no reason why fetch could not look into the cache created by a cache tag.

@fabien
Copy link
Contributor Author

fabien commented Apr 29, 2015

Yes, IIRC async tags will always execute, even when the parent block shouldn't run. It'd be interesting to see how the scenario above would best be implemented:

{% cache %}
<h1>{{ datestamp() }}</h1>
{% fetch 123 %} // async
{% endfetch %}
{% endcache %}

@jlongster
Copy link
Contributor

Ah, I can't remember how async tags are transformed, I'll take a look at it soon

@carljm carljm added async and removed question labels Dec 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants