Properties Methods Events Direct Link

Class CQ.Ext.util.TaskRunner

Package:CQ.Ext.util
Class:TaskRunner
Subclasses:TaskMgr
Extends:Object
Clientlib:cq.widgets
Provides the ability to execute one or more arbitrary tasks in a multithreaded manner. Generally, you can use the singleton CQ.Ext.TaskMgr instead, but if needed, you can create separate instances of TaskRunner. Any number of separate tasks can be started at any time and will run independently of each other. Example usage:
// Start a simple clock task that updates a div once per second
var updateClock = function(){
    CQ.Ext.fly('clock').update(new Date().format('g:i:s A'));
}
var task = {
    run: updateClock,
    interval: 1000 //1 second
}
var runner = new CQ.Ext.util.TaskRunner();
runner.start(task);

// equivalent using TaskMgr
CQ.Ext.TaskMgr.start({
    run: updateClock,
    interval: 1000
});

See the start method for details about how to configure a task object.

Also see CQ.Ext.util.DelayedTask.

Public Properties

This class has no public properties.

Public Methods

Method Defined By

Public Events

This class has no public events.