Mercurial > hg > nginx-site
changeset 2747:42fb92e582db
Added note to js_set about asyncronous calls.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Mon, 05 Jul 2021 15:32:26 +0100 |
parents | 438e5c551d67 |
children | 1d3a8a4adec2 |
files | xml/en/docs/http/ngx_http_js_module.xml xml/en/docs/stream/ngx_stream_js_module.xml xml/ru/docs/http/ngx_http_js_module.xml xml/ru/docs/stream/ngx_stream_js_module.xml |
diffstat | 4 files changed, 56 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/xml/en/docs/http/ngx_http_js_module.xml +++ b/xml/en/docs/http/ngx_http_js_module.xml @@ -9,7 +9,7 @@ <module name="Module ngx_http_js_module" link="/en/docs/http/ngx_http_js_module.html" lang="en" - rev="28"> + rev="29"> <section id="summary"> @@ -319,6 +319,19 @@ This handler can be used to do some clea right before the request is freed. </para> +<para> +<note> +As the <literal>js_set</literal> handler +returns its result immediately, it supports +only synchronous callbacks. +Thus, asynchronous callbacks such as +<link doc="../njs/reference.xml" id="r_subrequest">r.subrequest()</link> +or +<link doc="../njs/reference.xml" id="settimeout">setTimeout()</link> +are not supported. +</note> +</para> + </directive>
--- a/xml/en/docs/stream/ngx_stream_js_module.xml +++ b/xml/en/docs/stream/ngx_stream_js_module.xml @@ -9,7 +9,7 @@ <module name="Module ngx_stream_js_module" link="/en/docs/stream/ngx_stream_js_module.html" lang="en" - rev="27"> + rev="28"> <section id="summary"> @@ -280,6 +280,19 @@ This handler can be used to do some clea right before the request is freed. </para> +<para> +<note> +As the <literal>js_set</literal> handler +returns its result immediately, it supports +only synchronous callbacks. +Thus, asynchronous callbacks such as +<link doc="../njs/reference.xml" id="ngx_fetch">ngx.fetch()</link> +or +<link doc="../njs/reference.xml" id="settimeout">setTimeout()</link> +are not supported. +</note> +</para> + </directive>
--- a/xml/ru/docs/http/ngx_http_js_module.xml +++ b/xml/ru/docs/http/ngx_http_js_module.xml @@ -9,7 +9,7 @@ <module name="Модуль ngx_http_js_module" link="/ru/docs/http/ngx_http_js_module.html" lang="ru" - rev="28"> + rev="29"> <section id="summary"> @@ -320,6 +320,19 @@ function version(r) { непосредственно перед освобождением запроса. </para> +<para> +<note> +Так как обработчик <literal>js_set</literal> +должен сразу возвращать результат, +то поддерживаются только синхронные вызовы, +Таким образом, асинхронные вызовы, например +<link doc="../njs/reference.xml" id="r_subrequest">r.subrequest()</link> +или +<link doc="../njs/reference.xml" id="settimeout">setTimeout()</link>, +не поддерживаются. +</note> +</para> + </directive>
--- a/xml/ru/docs/stream/ngx_stream_js_module.xml +++ b/xml/ru/docs/stream/ngx_stream_js_module.xml @@ -9,7 +9,7 @@ <module name="Модуль ngx_stream_js_module" link="/ru/docs/stream/ngx_stream_js_module.html" lang="ru" - rev="27"> + rev="28"> <section id="summary"> @@ -281,6 +281,19 @@ function address(s) { непосредственно перед освобождением запроса. </para> +<para> +<note> +Так как обработчик <literal>js_set</literal> +должен сразу возвращать результат, +то поддерживаются только синхронные вызовы. +Таким образом, асинхронные вызовы, например +<link doc="../njs/reference.xml" id="ngx_fetch">ngx.fetch()</link> +или +<link doc="../njs/reference.xml" id="settimeout">setTimeout()</link>, +не поддерживаются. +</note> +</para> + </directive>