comparison xml/en/docs/njs/reference.xml @ 2679:8f3e9ff2785f

Corrected syntax of njs.on() and ngx.fetch() in njs Reference.
author Yaroslav Zhuravlev <yar@nginx.com>
date Fri, 12 Mar 2021 18:09:09 +0000
parents e53592a1d979
children 5282d6d3d849
comparison
equal deleted inserted replaced
2678:a4d3e6db81b9 2679:8f3e9ff2785f
7 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd"> 7 <!DOCTYPE article SYSTEM "../../../../dtd/article.dtd">
8 8
9 <article name="Reference" 9 <article name="Reference"
10 link="/en/docs/njs/reference.html" 10 link="/en/docs/njs/reference.html"
11 lang="en" 11 lang="en"
12 rev="67"> 12 rev="68">
13 13
14 <section id="summary"> 14 <section id="summary">
15 15
16 <para> 16 <para>
17 <link doc="index.xml">njs</link> provides objects, methods and properties 17 <link doc="index.xml">njs</link> provides objects, methods and properties
494 sets an exit <literal>code</literal> for the current 494 sets an exit <literal>code</literal> for the current
495 <link doc="../stream/stream_processing.xml">phase</link> handler 495 <link doc="../stream/stream_processing.xml">phase</link> handler
496 to a code value, by default <literal>0</literal>. 496 to a code value, by default <literal>0</literal>.
497 The actual finalization happens when the js handler is completed 497 The actual finalization happens when the js handler is completed
498 and all pending events, for example, from 498 and all pending events, for example, from
499 <link id="ngx_fetch"><literal>ngx.fetch</literal></link> or 499 <link id="ngx_fetch"><literal>ngx.fetch()</literal></link> or
500 <link id="settimeout"><literal>setTimeout()</literal></link>, 500 <link id="settimeout"><literal>setTimeout()</literal></link>,
501 are processed 501 are processed
502 (<link doc="changes.xml" id="njs0.2.4">0.2.4</link>). 502 (<link doc="changes.xml" id="njs0.2.4">0.2.4</link>).
503 <para> 503 <para>
504 Possible code values: 504 Possible code values:
874 <tag-name id="njs_dump"><literal>njs.dump(<value>value</value>)</literal></tag-name> 874 <tag-name id="njs_dump"><literal>njs.dump(<value>value</value>)</literal></tag-name>
875 <tag-desc> 875 <tag-desc>
876 Returns the pretty-print string representation for a value. 876 Returns the pretty-print string representation for a value.
877 </tag-desc> 877 </tag-desc>
878 878
879 <tag-name id="njs_on"><literal>njs.on</literal></tag-name> 879 <tag-name id="njs_on"><literal>njs.on(<value>event</value>,
880 <value>callback</value>)</literal></tag-name>
880 <tag-desc> 881 <tag-desc>
881 Registers a callback for the specified VM event 882 Registers a callback for the specified VM event
882 (since <link doc="changes.xml" id="njs0.5.2">0.5.2</link>). 883 (since <link doc="changes.xml" id="njs0.5.2">0.5.2</link>).
883 An event may be one of the following strings: 884 An event may be one of the following strings:
884 <list type="tag"> 885 <list type="tag">