/* This file is part of Ext JS 3.4 Copyright (c) 2011-2013 Sencha Inc Contact: http://www.sencha.com/contact GNU General Public License Usage This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file. Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html. If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact. Build date: 2013-04-03 15:07:25 */ Ext.data.JsonP.Ext_util_TaskRunner({"alternateClassNames":[],"aliases":{},"enum":null,"parentMixins":[],"tagname":"class","subclasses":["Ext.TaskMgr"],"extends":null,"uses":[],"html":"

Subclasses

Files

Provides the ability to execute one or more arbitrary tasks in a multithreaded\nmanner. Generally, you can use the singleton Ext.TaskMgr instead, but\nif needed, you can create separate instances of TaskRunner. Any number of\nseparate tasks can be started at any time and will run independently of each\nother. Example usage:

\n\n
// Start a simple clock task that updates a div once per second\nvar updateClock = function(){\n    Ext.fly('clock').update(new Date().format('g:i:s A'));\n} \nvar task = {\n    run: updateClock,\n    interval: 1000 //1 second\n}\nvar runner = new Ext.util.TaskRunner();\nrunner.start(task);\n\n// equivalent using TaskMgr\nExt.TaskMgr.start({\n    run: updateClock,\n    interval: 1000\n});\n\n
\n\n\n

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

\n\n\n

Also see Ext.util.DelayedTask.

\n
Defined By

Methods

Ext.util.TaskRunner
view source
new( [interval] ) : Ext.util.TaskRunner
...
\n

Parameters

  • interval : Number (optional)

    The minimum precision in milliseconds supported by this TaskRunner instance\n(defaults to 10)

    \n

Returns

Ext.util.TaskRunner
view source
( task ) : Object
Starts a new task. ...

Starts a new task.

\n

Parameters

  • task : Object

    A config object that supports the following properties:

      \n
    • run : Function

      The function to execute each time the task is invoked. The\nfunction will be called at each interval and passed the args argument if specified, and the\ncurrent invocation count if not.

      \n

      If a particular scope (this reference) is required, be sure to specify it using the scope argument.

      \n

      Return false from this function to terminate the task.

    • \n
    • interval : Number
      The frequency in milliseconds with which the task\nshould be invoked.
    • \n
    • args : Array
      (optional) An array of arguments to be passed to the function\nspecified by run. If not specified, the current invocation count is passed.
    • \n
    • scope : Object
      (optional) The scope (this reference) in which to execute the\nrun function. Defaults to the task config object.
    • \n
    • duration : Number
      (optional) The length of time in milliseconds to invoke\nthe task before stopping automatically (defaults to indefinite).
    • \n
    • repeat : Number
      (optional) The number of times to invoke the task before\nstopping automatically (defaults to indefinite).
    • \n

    \n\n\n

    Before each invocation, Ext injects the property taskRunCount into the task object so\nthat calculations based on the repeat count can be performed.

    \n\n

Returns

  • Object

    The task

    \n
Ext.util.TaskRunner
view source
( task ) : Object
Stops an existing running task. ...

Stops an existing running task.

\n

Parameters

  • task : Object

    The task to stop

    \n

Returns

  • Object

    The task

    \n
Ext.util.TaskRunner
view source
( )
Stops all tasks that are currently running. ...

Stops all tasks that are currently running.

\n
","superclasses":[],"meta":{},"requires":[],"html_meta":{},"statics":{"property":[],"cfg":[],"css_var":[],"method":[],"event":[],"css_mixin":[]},"files":[{"href":"TaskMgr.html#Ext-util-TaskRunner","filename":"TaskMgr.js"}],"linenr":1,"members":{"property":[],"cfg":[],"css_var":[],"method":[{"tagname":"method","owner":"Ext.util.TaskRunner","meta":{},"name":"constructor","id":"method-constructor"},{"tagname":"method","owner":"Ext.util.TaskRunner","meta":{},"name":"start","id":"method-start"},{"tagname":"method","owner":"Ext.util.TaskRunner","meta":{},"name":"stop","id":"method-stop"},{"tagname":"method","owner":"Ext.util.TaskRunner","meta":{},"name":"stopAll","id":"method-stopAll"}],"event":[],"css_mixin":[]},"inheritable":null,"private":null,"component":false,"name":"Ext.util.TaskRunner","singleton":false,"override":null,"inheritdoc":null,"id":"class-Ext.util.TaskRunner","mixins":[],"mixedInto":[]});