API Documentation for: 1.0.0
Show:

Task Class

Defined in: Task:6
Namespace: cloudkid

A task is used by the Task Manager to do an asyncronous task (like loading or playback)

Constructor

Task

(
  • id
  • callback
)

Defined in Task:6

Parameters:

  • id String

    Alias for the task

  • callback Function

    Function to call when the task is completed

Methods

cancel

() Bool

Defined in cancel:83

Cancel the task - for use in inherited classes

Returns:

Bool:

If the cancel was successful

destroy

()

Defined in destroy:104

If this task has been __isDestroyed Don't use after this

done

(
  • result
  • manager
)

Defined in done:58

Called from the task manager when a Task is finished

Parameters:

  • result Type

    The resulting data from the return

  • manager TaskManager

    The reference to the manager

initialize

(
  • id
  • callback
)

Defined in initialize:45

Make a task but don't load

Parameters:

  • id String

    ID of the task

  • callback Function

    Callback to to call with the result, this task, and the TaskManager that started it

start

(
  • callback
)

Defined in start:72

Start the load. This implementation is a NOP.

Parameters:

  • callback Function

    Callback to call when the load is done

toString

() String

Defined in toString:93

Get a string representation of this task

Returns:

String:

A string representation of this task

Properties

_isDestroyed

Bool protected

Defined in _isDestroyed:37

Bool to keep track if this has been destroyed

callback

Function

Defined in callback:30

Callback to call when the task is completed

id

String

Defined in id:23

The unique id of the task