Mercurial > hg > nginx-site
comparison xml/en/docs/http/ngx_http_js_module.xml @ 2787:005b056c267f
Added note about async calls for js_body_filter, js_header_filter.
author | Yaroslav Zhuravlev <yar@nginx.com> |
---|---|
date | Thu, 21 Oct 2021 15:11:56 +0100 |
parents | 65591dd31d64 |
children | 652356b39f0f |
comparison
equal
deleted
inserted
replaced
2786:6b3a80a735bf | 2787:005b056c267f |
---|---|
7 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> | 7 <!DOCTYPE module SYSTEM "../../../../dtd/module.dtd"> |
8 | 8 |
9 <module name="Module ngx_http_js_module" | 9 <module name="Module ngx_http_js_module" |
10 link="/en/docs/http/ngx_http_js_module.html" | 10 link="/en/docs/http/ngx_http_js_module.html" |
11 lang="en" | 11 lang="en" |
12 rev="32"> | 12 rev="33"> |
13 | 13 |
14 <section id="summary"> | 14 <section id="summary"> |
15 | 15 |
16 <para> | 16 <para> |
17 The <literal>ngx_http_js_module</literal> module is used to implement | 17 The <literal>ngx_http_js_module</literal> module is used to implement |
211 (if any) in | 211 (if any) in |
212 <link id="js_header_filter"><literal>js_header_filter</literal></link> | 212 <link id="js_header_filter"><literal>js_header_filter</literal></link> |
213 to enforce chunked transfer encoding. | 213 to enforce chunked transfer encoding. |
214 </para> | 214 </para> |
215 | 215 |
216 <para> | |
217 <note> | |
218 As the <literal>js_body_filter</literal> handler | |
219 returns its result immediately, it supports | |
220 only synchronous operations. | |
221 Thus, asynchronous operations such as | |
222 <link doc="../njs/reference.xml" id="r_subrequest">r.subrequest()</link> | |
223 or | |
224 <link doc="../njs/reference.xml" id="settimeout">setTimeout()</link> | |
225 are not supported. | |
226 </note> | |
227 </para> | |
228 | |
216 </directive> | 229 </directive> |
217 | 230 |
218 | 231 |
219 <directive name="js_content"> | 232 <directive name="js_content"> |
220 <syntax><value>function</value> | <value>module.function</value></syntax> | 233 <syntax><value>function</value> | <value>module.function</value></syntax> |
317 <appeared-in>0.5.1</appeared-in> | 330 <appeared-in>0.5.1</appeared-in> |
318 | 331 |
319 <para> | 332 <para> |
320 Sets an njs function as a response header filter. | 333 Sets an njs function as a response header filter. |
321 The directive allows changing arbitrary header fields of a response header. | 334 The directive allows changing arbitrary header fields of a response header. |
335 </para> | |
336 | |
337 <para> | |
338 <note> | |
339 As the <literal>js_header_filter</literal> handler | |
340 returns its result immediately, it supports | |
341 only synchronous operations. | |
342 Thus, asynchronous operations such as | |
343 <link doc="../njs/reference.xml" id="r_subrequest">r.subrequest()</link> | |
344 or | |
345 <link doc="../njs/reference.xml" id="settimeout">setTimeout()</link> | |
346 are not supported. | |
347 </note> | |
322 </para> | 348 </para> |
323 | 349 |
324 </directive> | 350 </directive> |
325 | 351 |
326 | 352 |
428 | 454 |
429 <para> | 455 <para> |
430 <note> | 456 <note> |
431 As the <literal>js_set</literal> handler | 457 As the <literal>js_set</literal> handler |
432 returns its result immediately, it supports | 458 returns its result immediately, it supports |
433 only synchronous callbacks. | 459 only synchronous operations. |
434 Thus, asynchronous callbacks such as | 460 Thus, asynchronous operations such as |
435 <link doc="../njs/reference.xml" id="r_subrequest">r.subrequest()</link> | 461 <link doc="../njs/reference.xml" id="r_subrequest">r.subrequest()</link> |
436 or | 462 or |
437 <link doc="../njs/reference.xml" id="settimeout">setTimeout()</link> | 463 <link doc="../njs/reference.xml" id="settimeout">setTimeout()</link> |
438 are not supported. | 464 are not supported. |
439 </note> | 465 </note> |