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>
8.9 KiB
8.9 KiB
Asynchronous Invocation
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, configure asynchronous settings.
- The following triggers are invoked asynchronously by default and the invocation mode cannot be changed.
Table 1 Invocation mode Event Source
Invocation Mode
SMN
Asynchronous
OBS
Asynchronous
DIS
Asynchronous
Timer
Asynchronous
LTS
Asynchronous
CTS
Asynchronous
DDS
Asynchronous
DMS for Kafka
Asynchronous
- 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).
Example
The following procedure uses the APIG trigger of a function as an example.
- Go to the function details page, and choose Configuration > Triggers.
- Click the APIG trigger name to go to the APIG console.
- Click Edit in the upper right.
- Click Next until the Define Backend Request page is displayed. Then change Invocation Mode to Asynchronous.
- Click Finish to save the settings.
Parent topic: Invoking the Function