Class TaskServer represents a task server class.
The TaskServer class defines methods to get information about a task server.
- Examples
- /Users/ec2-user/gitlab-runner/builds/E-xKdhDo/0/foxit/sdk/mobile/gsdk-doc-auto-build/harmony_nodejs/input/Index.js.
◆ addTask()
| TaskServer.addTask |
( |
task |
| ) |
|
Adds a task to the server.
- Parameters
-
| {Task} | task - The task to be added to the server. |
◆ cancelAllTasks()
| TaskServer.cancelAllTasks |
( |
force |
| ) |
|
Cancels all tasks.
- Parameters
-
| {boolean} | force - If true, forces the cancellation of all tasks immediately. |
◆ cancelTask()
| TaskServer.cancelTask |
( |
task |
, |
|
|
addToQueue |
|
|
) |
| |
Cancels a specific task.
- Parameters
-
| {Task} | task - The task to be cancelled. |
| {boolean} | addToQueue - If true, the task result is added to a queue for further processing. |
◆ getCurTask()
| TaskServer.getCurTask |
( |
| ) |
|
Retrieves the current task.
- Returns
- {Task} The current task being processed by the server.
◆ handleTaskResult()
| TaskServer.handleTaskResult |
( |
task |
, |
|
|
isSync |
, |
|
|
addToQueue |
|
|
) |
| |
Handles the result of a task.
- Parameters
-
| {Task} | task - The task whose result is to be handled. |
| {boolean} | isSync - If true, the task result is handled synchronously. |
| {boolean} | addToQueue - If true, the task result is added to a queue for further processing. |
◆ setMachineStatus()
| TaskServer.setMachineStatus |
( |
status |
| ) |
|
Sets the machine status.
- Parameters
-
| {number} | status - The new status to be set for the machine. |