Mercurial > hg > nginx-site
diff xml/en/docs/stream/ngx_stream_js_module.xml @ 2686:45214e5316cd
Improved description of js_set.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Fri, 19 Mar 2021 18:24:34 +0000 |
parents | 8751cab1d562 |
children | 3cbd6e440581 |
line wrap: on
line diff
--- a/xml/en/docs/stream/ngx_stream_js_module.xml Fri Mar 19 18:24:34 2021 +0000 +++ b/xml/en/docs/stream/ngx_stream_js_module.xml Fri Mar 19 18:24:34 2021 +0000 @@ -9,7 +9,7 @@ <module name="Module ngx_stream_js_module" link="/en/docs/stream/ngx_stream_js_module.html" lang="en" - rev="24"> + rev="25"> <section id="summary"> @@ -259,11 +259,27 @@ <context>stream</context> <para> -Sets an njs function for the specified variable. +Sets an njs <literal>function</literal> +for the specified <literal>variable</literal>. Since <link doc="../njs/changes.xml" id="njs0.4.0">0.4.0</link>, a module function can be referenced. </para> +<para> +The function is called when +the variable is referenced for the first time for a given request. +The exact moment depends on a +<link doc="stream_processing.xml">phase</link> +at which the variable is referenced. +This can be used to perform some logic +not related to variable evaluation. +For example, if the variable is referenced only in the +<link doc="ngx_stream_log_module.xml" id="log_format"/> directive, +its handler will not be executed until the log phase. +This handler can be used to do some cleanup +right before the request is freed. +</para> + </directive> </section>