mirror of
https://gitee.com/openharmony/interface_sdk-js
synced 2024-10-08 07:36:38 +00:00
!9531 [taskpool] add interface for LongTask
Merge pull request !9531 from huangfeijie/taskpool_interface
This commit is contained in:
commit
f3a083816e
24
api/@ohos.taskpool.d.ts
vendored
24
api/@ohos.taskpool.d.ts
vendored
@ -559,6 +559,18 @@ declare namespace taskpool {
|
||||
execute(task: Task): Promise<Object>;
|
||||
}
|
||||
|
||||
/**
|
||||
* The LongTask class provides an interface to create a task that has no upper limit on execution time.
|
||||
*
|
||||
* @extends Task
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 12
|
||||
*/
|
||||
class LongTask extends Task {
|
||||
}
|
||||
|
||||
/**
|
||||
* The State defines the task state.
|
||||
*
|
||||
@ -1054,6 +1066,18 @@ declare namespace taskpool {
|
||||
* @since 11
|
||||
*/
|
||||
function getTaskPoolInfo(): TaskPoolInfo;
|
||||
|
||||
/**
|
||||
* Terminate a long task.
|
||||
*
|
||||
* @param { LongTask } longTask - The long task want to terminate.
|
||||
* @throws { BusinessError } 401 - The input parameters are invalid.
|
||||
* @syscap SystemCapability.Utils.Lang
|
||||
* @crossplatform
|
||||
* @atomicservice
|
||||
* @since 12
|
||||
*/
|
||||
function terminateTask(longTask: LongTask): void;
|
||||
}
|
||||
|
||||
export default taskpool;
|
||||
|
Loading…
Reference in New Issue
Block a user