Skip to main content

Task and Thread Actions

Task actions provide features for running and interacting with asynchronous tasks managed by the XINA Run application or AWS Lambda platform.

Task Actions

RUN

Run one or more asynchronous tasks.

Example

{
  "action" : "run",
  "tasks"  : [ <task definition>, ... ]
}

Task Definition

{
  "name": <string, task name>,
  "conf": <JSON object, format depends on task>,
  "parent": <long, parent task ID, optional>,
  "thread": <string, thread name, optional>,
  "auto": <boolean, optional, default false>,
  "archive": <boolean, optional, default false>,
  "open": <boolean, optional, default false>,
  "desc": <string, optional>,
  "priority": <int, optional>,
  "timeout": <int, ms, optional>,
  "ref_id": <long, optional>
}

CONCLUDE

Explicitly conclude an asynchronous task. This is currently only used by AWS Lambda tasks, to notify the XINA server that the task has concluded. If a value is provided for "delay", the server will wait that many milliseconds before concluding the task. This supports tasks that may have a longer cleanup or import period following the immediate task completion.

Example

{
  "action" : "conclude",
  "task"   : <task ID>,
  "delay"  : <number, ms, 0-5000, optional, default 0>
}

CANCEL

Cancel one or more asynchronous tasks.

Only non-concluded tasks may be canceled. If "ignore" is false, and any specified tasks have concluded, an error will be thrown and no changes will occur. If "ignore" is true, all non-concluded specified tasks will be canceled, and any concluded tasks will be ignored.

Example

{
  "action" : "cancel",
  "tasks"  : [ <task ID>, ... ],
  "ignore" : <boolean, optional, default false>
}

CLEAN

Permanently delete one or more asynchronous task records and any associated files.

Only concluded tasks may be cleaned. If "ignore" is false, and any specified tasks have not concluded, an error will be thrown and no changes will occur. If "ignore" is true, all concluded specified tasks will be cleaned, and any non-concluded tasks will be ignored.

Example

{
  "action" : "clean",
  "tasks"  : [ <task ID>, ... ],
  "ignore" : <boolean, optional, default false>
}

DESTROY

Cancel and clean one or more asynchronous tasks.


Thread Actions

PAUSE


RESUME