will env.render() block node process?

11 views
Skip to first unread message

Valter Rodrigues

unread,
May 9, 2016, 1:32:11 PM5/9/16
to Nunjucks
I know this is a very newbie question but it's killing me.

So, would do something like 

cont html = env.render(tpl, contextVars);

block my node js process?

thanks in advance.

Carl Meyer

unread,
May 9, 2016, 3:35:13 PM5/9/16
to nunj...@googlegroups.com
Hi Valter,

On 05/09/2016 11:32 AM, Valter Rodrigues wrote:
> I know this is a very newbie question but it's killing me.
>
> So, would do something like
>
> cont html = env.render(tpl, contextVars);
>
> block my node js process?

Yes it will. If you don't want it to, you can pass a third callback
argument to `render`, which will activate async mode. See
http://mozilla.github.io/nunjucks/api.html#asynchronous-support

Carl

signature.asc

Valter Rodrigues

unread,
May 10, 2016, 7:39:28 AM5/10/16
to Nunjucks
Ok. I'll use the version with the callback then. 
Thank you.
Reply all
Reply to author
Forward
0 new messages