change readme
Signed-off-by: 廖康康 <liaokangkang@huawei.com>
This commit is contained in:
parent
1db92c33a3
commit
a5dea11837
|
@ -13,6 +13,8 @@
|
|||
|
||||
In the resource scheduling subsystem, the background task management is responsible for managing background tasks, and provides interfaces for application, cancellation and query of background tasks.
|
||||
|
||||
![](figures/en-us_image_0000001115940671.png)
|
||||
|
||||
## Directory Structure<a name="section161941989596"></a>
|
||||
|
||||
```
|
||||
|
@ -45,8 +47,6 @@ As mentioned above, applications and service modules with transient tasks have t
|
|||
|
||||
#### Restrictions on Using Transient Tasks<a name="section1551164914237"></a>
|
||||
|
||||
Adhere to the following constraints and rules when using transient tasks:
|
||||
|
||||
- **When to request**:An application can request a transient task only when it is running in the foreground or before it is suspended in the background. Otherwise, the application may be suspended, resulting in request failure. By default, an application has 6–12 seconds of running time (subject to the application scenario) before it is suspended in the background.
|
||||
- **Timeout**:The system notifies the application of the suspension delay timeout by using a callback. The application must then cancel the delayed suspension or apply for delayed suspension again. Otherwise, the application will be forcibly suspended.
|
||||
- **When to cancel**:The requesting application shall cancel the request when the transient task is complete. If the request is forcibly canceled by the system, the time frame allowed for the application to run in the background will be affected.
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
在资源调度子系统中后台任务管理负责管理后台任务,并提供后台任务的申请、取消和查询等接口。
|
||||
|
||||
![](figures/zh-cn_image_0000001115940671.png)
|
||||
|
||||
## 目录<a name="section161941989596"></a>
|
||||
|
||||
```
|
||||
|
@ -45,12 +47,10 @@
|
|||
|
||||
#### 短时任务使用约束<a name="section1551164914237"></a>
|
||||
|
||||
短时任务的使用需要遵从如下约束和规则:
|
||||
|
||||
- **申请时机**:允许应用在前台时,或退后台在被挂起之前(应用退到后台默认有6~12秒的运行时长,具体时长由系统根据具体场景决定)申请延迟挂起,否则可能被挂起(Suspend),导致申请失败。
|
||||
- **超时**:延迟挂起超时(Timeout),系统通过回调知会应用,应用需要取消对应的延迟挂起,或再次申请延迟挂起。超期不取消或不处理,该应用会被强制取消延迟挂起。
|
||||
- **取消时机**:任务完成后申请方应用主动取消延时申请,不要等到超时后被系统取消,否则会影响该应用的后台允许运行时长配额。
|
||||
- **配额机制**:为了防止应用滥用保活,或者申请后不取消,每个应用每天都会有一定配额(会根据用户的使用习惯动态调整),配额消耗完就不再允许申请短时任务,所以应用完成短时任务后立刻取消延时申请,避免消耗配额。(注,这个配额指的是申请的时长,系统默认应用在后台运行的时间不计算在内)。
|
||||
- **配额机制**:为了防止应用滥用保活,或者申请后不取消,每个应用每天都会有一定配额(会根据用户的使用习惯动态调整),配额消耗完就不再允许申请短时任务,所以应用完成短时任务后立刻取消延时申请,避免消耗配额。(注,这个配额指的是申请的时长,系统默认应用在后台运行的时间不计算在内。)
|
||||
|
||||
## 相关仓<a name="section1371113476307"></a>
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 146 KiB |
Binary file not shown.
After Width: | Height: | Size: 132 KiB |
Loading…
Reference in New Issue