Mercurial > hg > nginx-site
changeset 3014:c0a4a4a55e45
Documented Periodic Session object in njs Reference.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Fri, 29 Sep 2023 20:06:59 +0100 |
parents | 1ad61bfc7630 |
children | 3a85326ed38c |
files | xml/en/docs/http/ngx_http_js_module.xml xml/en/docs/njs/compatibility.xml xml/en/docs/njs/reference.xml xml/en/docs/stream/ngx_stream_js_module.xml xml/ru/docs/http/ngx_http_js_module.xml xml/ru/docs/njs/compatibility.xml xml/ru/docs/stream/ngx_stream_js_module.xml |
diffstat | 7 files changed, 70 insertions(+), 11 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="43"> + rev="44"> <section id="summary"> @@ -553,7 +553,9 @@ since <link doc="../njs/changes.xml" id= <para> Specifies a content handler to run at regular interval. -The handler receives a session object as its first argument, +The handler receives a +<link doc="../njs/reference.xml" id="periodic_session">session object</link> +as its first argument, it also has access to global objects such as <link doc="../njs/reference.xml" id="ngx">ngx</link>. </para>
--- a/xml/en/docs/njs/compatibility.xml +++ b/xml/en/docs/njs/compatibility.xml @@ -9,7 +9,7 @@ <article name="Compatibility" link="/en/docs/njs/compatibility.html" lang="en" - rev="41" + rev="42" toc="no"> <section> @@ -1182,6 +1182,14 @@ nginx object properties: </listitem> <listitem> +<link doc="reference.xml" id="periodic_session"><literal>Periodic Session</literal></link> +(<link doc="changes.xml" id="njs0.8.1">0.8.1</link>): +<link doc="reference.xml" id="periodic_session_raw_variables"><literal>PeriodicSession.rawVariables</literal></link>, +<link doc="reference.xml" id="periodic_session_variables"><literal>PeriodicSession.variables</literal></link> +</listitem> + + +<listitem> <link doc="reference.xml" id="request"><literal>Request</literal></link> (<link doc="changes.xml" id="njs0.7.10">0.7.10</link>): <link doc="reference.xml" id="request_bodyused"><literal>bodyUsed</literal></link>,
--- a/xml/en/docs/njs/reference.xml +++ b/xml/en/docs/njs/reference.xml @@ -9,7 +9,7 @@ <article name="Reference" link="/en/docs/njs/reference.html" lang="en" - rev="116"> + rev="117"> <section id="summary"> @@ -1008,6 +1008,44 @@ only first 2048 bytes of the string can </section> +<section id="periodic_session" name="Periodic Session"> + +<para> +<table width="100%"> +<tr><td><link id="periodic_session_raw_variables"><literal>PeriodicSession.rawVariables{}</literal></link></td></tr> +<tr><td><link id="periodic_session_variables"><literal>PeriodicSession.variables{}</literal></link></td></tr> +</table> +</para> + +<para> +The <literal>Periodic Session</literal> object is provided as the first argument +for the <literal>js_periodic</literal> handler for +<link doc="../http/ngx_http_js_module.xml" id="js_periodic">http</link> +and +<link doc="../stream/ngx_stream_js_module.xml" id="js_periodic">stream</link> +(since <link doc="changes.xml" id="njs0.8.1">0.8.1</link>). +</para> + +<para> +<list type="tag"> + +<tag-name id="periodic_session_raw_variables"><literal>PeriodicSession.rawVariables{}</literal></tag-name> +<tag-desc> +nginx <link id="periodic_session_variables">variables</link> as Buffers, +writable. +</tag-desc> + +<tag-name id="periodic_session_variables"><literal>PeriodicSession.variables{}</literal></tag-name> +<tag-desc> +<link doc="../varindex.xml">nginx variables</link> object, writable. +</tag-desc> + +</list> +</para> + +</section> + + <section id="headers" name="Headers"> <para>
--- 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="42"> + rev="43"> <section id="summary"> @@ -470,7 +470,9 @@ since <link doc="../njs/changes.xml" id= <para> Specifies a content handler to run at regular interval. -The handler receives a session object as its first argument, +The handler receives a +<link doc="../njs/reference.xml" id="periodic_session">session object</link> +as its first argument, it also has access to global objects such as <link doc="../njs/reference.xml" id="ngx">ngx</link>. </para>
--- 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="43"> + rev="44"> <section id="summary"> @@ -554,7 +554,8 @@ function version(r) { <para> Задаёт периодичность запуска обработчика содержимого. -В качестве первого аргумента обработчик получает объект сессии, +В качестве первого аргумента обработчик получает +<link doc="../njs/reference.xml" id="periodic_session">объект сессии</link>, также у обработчика есть доступ к глобальным объектам таким как <link doc="../njs/reference.xml" id="ngx">ngx</link>. </para>
--- a/xml/ru/docs/njs/compatibility.xml +++ b/xml/ru/docs/njs/compatibility.xml @@ -9,7 +9,7 @@ <article name="Совместимость" link="/ru/docs/njs/compatibility.html" lang="ru" - rev="41" + rev="42" toc="no"> <section> @@ -1182,6 +1182,13 @@ ES6 поддержка стрелочных функций </listitem> <listitem> +<link doc="reference.xml" id="periodic_session"><literal>Periodic Session</literal></link> +(<link doc="changes.xml" id="njs0.8.1">0.8.1</link>): +<link doc="reference.xml" id="periodic_session_raw_variables"><literal>PeriodicSession.rawVariables</literal></link>, +<link doc="reference.xml" id="periodic_session_variables"><literal>PeriodicSession.variables</literal></link> +</listitem> + +<listitem> <link doc="reference.xml" id="request"><literal>Request</literal></link> (<link doc="changes.xml" id="njs0.7.10">0.7.10</link>): <link doc="reference.xml" id="request_bodyused"><literal>bodyUsed</literal></link>,
--- 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="42"> + rev="43"> <section id="summary"> @@ -567,7 +567,8 @@ js_preload_object map.json; <para> Задаёт периодичность запуска обработчика содержимого. -В качестве первого аргумента обработчик получает объект сессии, +В качестве первого аргумента обработчик получает +<link doc="../njs/reference.xml" id="periodic_session">объект сессии</link>, также у обработчика есть доступ к глобальным объектам таким как <link doc="../njs/reference.xml" id="ngx">ngx</link>. </para>