Zebra API Doc

zebra.util.TaskCotext Class

Task is keeps a context of and allows developers to run, shutdown, pause a required method as a task Developer cannot instantiate the class directly. Use "zebra.util.task(...)" method to do it:

   var t = zebra.util.task(function(context) {
       // task body
       ...
   });

   // run task in 1 second and repeat the task execution 
   // every half second
   t.run(1000, 500);
   ...

   t.shutdown(); // stop the task

Item Index

Methods

Attributes

Methods

pause

()

Pause the given task.

run

(
  • [startIn]
  • [repeatIn]
)

Run the task

Parameters:

  • [startIn] Integer optional

    a time (in milliseconds) in which the task has to be started

  • [repeatIn] Integer optional

    a period (in milliseconds) the task has to be executed

shutdown

()

Shutdown the given task.

Attributes

isStarted

Boolean readonly

Indicates if the task is executed (active)