forked from docs/doc-exports
Reviewed-by: Eotvos, Oliver <oliver.eotvos@t-systems.com> Co-authored-by: Chen, Junjie <chenjunjie@huawei.com> Co-committed-by: Chen, Junjie <chenjunjie@huawei.com>
71 lines
8.9 KiB
HTML
71 lines
8.9 KiB
HTML
<a name="functiongraph_01_1062"></a><a name="functiongraph_01_1062"></a>
|
|
|
|
<h1 class="topictitle1">Asynchronous Invocation</h1>
|
|
<div id="body32001227"><p id="functiongraph_01_1062__en-us_topic_0000001298667449_p6643104074513">When a client triggers a function, FunctionGraph persists the request and sends a response immediately to the client. The client proceeds without waiting for the execution result. You cannot know the result in real time. FunctionGraph queues the asynchronous requests and processes them when the server is idle. To obtain asynchronous processing results or to retry when an asynchronous request fails, <a href="functiongraph_01_0390_03.html#functiongraph_01_0390_03">configure asynchronous settings</a>.</p>
|
|
<ul id="functiongraph_01_1062__en-us_topic_0000001298667449_ul1441412313577"><li id="functiongraph_01_1062__en-us_topic_0000001298667449_li241413118576">The following triggers are invoked asynchronously by default and the invocation mode cannot be changed.
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="functiongraph_01_1062__en-us_topic_0000001298667449_table194597279137" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Invocation mode</caption><thead align="left"><tr id="functiongraph_01_1062__en-us_topic_0000001298667449_row1445652731318"><th align="left" class="cellrowborder" valign="top" width="49.95%" id="mcps1.3.2.1.1.2.3.1.1"><p id="functiongraph_01_1062__en-us_topic_0000001298667449_p1545519276133">Event Source</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="50.05%" id="mcps1.3.2.1.1.2.3.1.2"><p id="functiongraph_01_1062__en-us_topic_0000001298667449_p1745532731310">Invocation Mode</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="functiongraph_01_1062__en-us_topic_0000001298667449_row3456227151320"><td class="cellrowborder" valign="top" width="49.95%" headers="mcps1.3.2.1.1.2.3.1.1 "><p id="functiongraph_01_1062__en-us_topic_0000001298667449_p1745618273136">SMN</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50.05%" headers="mcps1.3.2.1.1.2.3.1.2 "><p id="functiongraph_01_1062__en-us_topic_0000001298667449_p2045672720138">Asynchronous</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="functiongraph_01_1062__en-us_topic_0000001298667449_row1445614278137"><td class="cellrowborder" valign="top" width="49.95%" headers="mcps1.3.2.1.1.2.3.1.1 "><p id="functiongraph_01_1062__en-us_topic_0000001298667449_p745682712136">OBS</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50.05%" headers="mcps1.3.2.1.1.2.3.1.2 "><p id="functiongraph_01_1062__en-us_topic_0000001298667449_p845617278135">Asynchronous</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="functiongraph_01_1062__en-us_topic_0000001298667449_row5457152711137"><td class="cellrowborder" valign="top" width="49.95%" headers="mcps1.3.2.1.1.2.3.1.1 "><p id="functiongraph_01_1062__en-us_topic_0000001298667449_p11456627151317">DIS</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50.05%" headers="mcps1.3.2.1.1.2.3.1.2 "><p id="functiongraph_01_1062__en-us_topic_0000001298667449_p10456027121319">Asynchronous</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="functiongraph_01_1062__en-us_topic_0000001298667449_row1645752718135"><td class="cellrowborder" valign="top" width="49.95%" headers="mcps1.3.2.1.1.2.3.1.1 "><p id="functiongraph_01_1062__en-us_topic_0000001298667449_p184571027161318">Timer</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50.05%" headers="mcps1.3.2.1.1.2.3.1.2 "><p id="functiongraph_01_1062__en-us_topic_0000001298667449_p2045713278131">Asynchronous</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="functiongraph_01_1062__en-us_topic_0000001298667449_row1845892720131"><td class="cellrowborder" valign="top" width="49.95%" headers="mcps1.3.2.1.1.2.3.1.1 "><p id="functiongraph_01_1062__en-us_topic_0000001298667449_p11457327181318">LTS</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50.05%" headers="mcps1.3.2.1.1.2.3.1.2 "><p id="functiongraph_01_1062__en-us_topic_0000001298667449_p124571327101314">Asynchronous</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="functiongraph_01_1062__en-us_topic_0000001298667449_row12458112715133"><td class="cellrowborder" valign="top" width="49.95%" headers="mcps1.3.2.1.1.2.3.1.1 "><p id="functiongraph_01_1062__en-us_topic_0000001298667449_p13458192751319">CTS</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50.05%" headers="mcps1.3.2.1.1.2.3.1.2 "><p id="functiongraph_01_1062__en-us_topic_0000001298667449_p154586276133">Asynchronous</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="functiongraph_01_1062__en-us_topic_0000001298667449_row1458327181315"><td class="cellrowborder" valign="top" width="49.95%" headers="mcps1.3.2.1.1.2.3.1.1 "><p id="functiongraph_01_1062__en-us_topic_0000001298667449_p134580275139">DDS</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50.05%" headers="mcps1.3.2.1.1.2.3.1.2 "><p id="functiongraph_01_1062__en-us_topic_0000001298667449_p124581927171315">Asynchronous</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="functiongraph_01_1062__en-us_topic_0000001298667449_row10458127121310"><td class="cellrowborder" valign="top" width="49.95%" headers="mcps1.3.2.1.1.2.3.1.1 "><p id="functiongraph_01_1062__en-us_topic_0000001298667449_p11458827161311">DMS for Kafka</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="50.05%" headers="mcps1.3.2.1.1.2.3.1.2 "><p id="functiongraph_01_1062__en-us_topic_0000001298667449_p18458162710138">Asynchronous</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</li><li id="functiongraph_01_1062__en-us_topic_0000001298667449_li1338156195717">APIG and APIG (dedicated) triggers can be configured for asynchronous invocation on their console. You can also use the API described in section "Executing a Function Asynchronously" to trigger a function asynchronously. In this scenario, the maximum execution duration of a function is 12 hours (configured in the whitelist).<div class="note" id="functiongraph_01_1062__en-us_topic_0000001298667449_note1226627152219"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="functiongraph_01_1062__en-us_topic_0000001298667449_p1626627162219">If the E2E function execution latency exceeds 90s, asynchronous invocation is recommended. If synchronous invocation is used, no responses can be received after 90s due to gateway restrictions.</p>
|
|
</div></div>
|
|
</li></ul>
|
|
<p id="functiongraph_01_1062__en-us_topic_0000001298667449_p593210251409"><strong id="functiongraph_01_1062__en-us_topic_0000001298667449_b15740441689">Example</strong></p>
|
|
<p id="functiongraph_01_1062__en-us_topic_0000001298667449_p102085491717">The following procedure uses the APIG trigger of a function as an example.</p>
|
|
<ol id="functiongraph_01_1062__en-us_topic_0000001298667449_ol77442102410"><li id="functiongraph_01_1062__en-us_topic_0000001298667449_li8555115413245">Go to the function details page, and choose <strong id="functiongraph_01_1062__en-us_topic_0000001298667449_b16330191714161">Configuration</strong> > <strong id="functiongraph_01_1062__en-us_topic_0000001298667449_b6379519101615">Triggers</strong>.</li><li id="functiongraph_01_1062__en-us_topic_0000001298667449_li17562182410">Click the APIG trigger name to go to the APIG console.<div class="fignone" id="functiongraph_01_1062__en-us_topic_0000001298667449_fig35191826123615"><span class="figcap"><b>Figure 1 </b>Clicking a trigger name</span><br><span><img id="functiongraph_01_1062__en-us_topic_0000001298667449_image1519182643616" src="en-us_image_0000001352771114.png"></span></div>
|
|
</li><li id="functiongraph_01_1062__en-us_topic_0000001298667449_li191715712247">Click <strong id="functiongraph_01_1062__en-us_topic_0000001298667449_b206431455173">Edit</strong> in the upper right.<div class="fignone" id="functiongraph_01_1062__en-us_topic_0000001298667449_fig9790151093713"><span class="figcap"><b>Figure 2 </b>Clicking Edit</span><br><span><img id="functiongraph_01_1062__en-us_topic_0000001298667449_image679291023711" src="en-us_image_0000001402931181.png"></span></div>
|
|
</li><li id="functiongraph_01_1062__en-us_topic_0000001298667449_li6122165543013">Click <strong id="functiongraph_01_1062__en-us_topic_0000001298667449_b176123281918">Next</strong> until the <strong id="functiongraph_01_1062__en-us_topic_0000001298667449_b94059520195">Define Backend Request</strong> page is displayed. Then change <strong id="functiongraph_01_1062__en-us_topic_0000001298667449_b323162613196">Invocation Mode</strong> to <strong id="functiongraph_01_1062__en-us_topic_0000001298667449_b14532173161919">Asynchronous</strong>.<div class="fignone" id="functiongraph_01_1062__en-us_topic_0000001298667449_fig10657845163710"><span class="figcap"><b>Figure 3 </b>Changing the invocation mode</span><br><span><img id="functiongraph_01_1062__en-us_topic_0000001298667449_image166578451379" src="en-us_image_0000001403331673.png"></span></div>
|
|
</li><li id="functiongraph_01_1062__en-us_topic_0000001298667449_li891757152417">Click <strong id="functiongraph_01_1062__en-us_topic_0000001298667449_b497085311911">Finish</strong> to save the settings.</li></ol>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="functiongraph_01_0160.html">Invoking the Function</a></div>
|
|
</div>
|
|
</div>
|
|
|