Foxit PDF RDK

Public Member Functions | List of all members
TaskServer Class Reference
Inheritance diagram for TaskServer:

## Public Member Functions
| addTask (task)
| Adds a task to the server. More...
| cancelAllTasks (force)
| Cancels all tasks. More...
| cancelTask (task, addToQueue)
| Cancels a specific task. More...
| constructor ()
| Constructor.
| disableAddTask ()
| Disables the ability to add tasks. Prevents tasks from being added to the server.
| enableAddTask ()
| Enables the ability to add tasks. Allows tasks to be added to the server.
| getCurTask ()
| Retrieves the current task. More...
| handleTaskResult (task, isSync, addToQueue)
| Handles the result of a task. More...
| setMachineStatus (status)
| Sets the machine status. More...
Public Member Functions inherited from NativeObjectWrapper
| constructor (r)
| GetPointerAsNumber ()

## Detailed Description

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.

## Member Function Documentation

## ◆ 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.