- Documentation
Volcano Engine Function as a Service
User guide
Functions
Advanced settings
Asynchronous task
Overview of asynchronous tasks
Asynchronous task
Overview of asynchronous tasks
Overview of asynchronous tasks
Asynchronous tasks are a newly launched function execution mechanism in veFaaS. They respond to invocation requests in asynchronous mode, returning a RequestId immediately after event scheduling to end the invocation without blocking the caller's resources. Additionally, asynchronous tasks support tracking and persisting task status at each stage, providing robust task control and observability capabilities.
This topic describes the supported execution modes, use cases, and workflow of asynchronous tasks.
Mode selection
veFaaS allows you to execute asynchronous tasks in Webserver mode or Non-Webserver mode. These modes differ only in their runtime implementations. Their applicable scenarios are functionally equivalent. You can choose a mode based on your actual needs.
- Webserver mode: Similar to a conventional synchronous execution mode, this mode requires an HTTP server on the business side to handle a request and return a response after the request is executed. The difference is that after receiving a task submission request from the client, veFaaS does not synchronously wait for the HTTP server response, but immediately returns 202 Accepted to the client. veFaaS then asynchronously schedules the request in the background, sends it to the HTTP server, waits for a response, and determines whether the task succeeded based on the response status code (a status code greater than or equal to 400 indicates a failed task).
- Non-Webserver mode: Executes a one-off task script. The process exits upon successful completion or upon script exception. veFaaS determines task success by the exit code (0 = success, non-zero = failure). If a task times out, veFaaS forcibly terminates the process and marks it as failed.
Application scenarios
Asynchronous tasks are mainly suitable for long-running or compute-intensive workloads. They can address problems such as prolonged consumption of caller-side resources and stringent stability requirements on the invocation chain during synchronous calls. The specific scenarios are as follows:
- Audio, video, and image processing: Thumbnail generation, watermarking, pornographic content detection, transcoding, and more.
- Scheduled tasks: Scheduled data fetching, web scraping, and more.
- Offline computation: Asynchronous status refreshing, offline queries, and more.
- Large-scale data processing (ETL): Data cleansing, transformation, analysis, and more.
- CI/CD: Asynchronous image building and more.
- AI inference: Text-to-image, text-to-video, and more.
- AI training: Data collection, data preprocessing, feature engineering, model training, and more.
- High-performance computing: Industrial simulation and more.
warning
Asynchronous task execution introduces additional system overhead and is not suitable for the following latency-sensitive, high-QPS scenarios:
- Latency-sensitive scenarios that require an average latency below 100ms.
- Requiring a rate of hundreds of calls per second or even higher.
Procedure
- Create an asynchronous task function.
- Release the function and its configuration online.
- You can configure triggers to submit tasks through HTTP(S) invocations or other events.
- You can test functions by simulating task submission by a trigger.
- veFaaS supports tracking task execution status and querying execution records for up to the last 30 days or the most recent 1,000 executions, and provides comprehensive monitoring metrics and log observability capabilities.
Last updated: 2026.08.19 14:06:06