Upgrade to ExtJS 4.0.0 - Released 04/26/2011
[extjs.git] / docs / api / Ext.util.TaskRunner.html
diff --git a/docs/api/Ext.util.TaskRunner.html b/docs/api/Ext.util.TaskRunner.html
new file mode 100644 (file)
index 0000000..d7def8a
--- /dev/null
@@ -0,0 +1,109 @@
+<!DOCTYPE html><html><head><title>Ext.util.TaskRunner | Ext JS 4.0 Documentation</title><script type="text/javascript" src="../ext-all.js"></script><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../scrollbars.css" type="text/css"><link rel="stylesheet" href="../docs.css" type="text/css"><link id="styleCss" rel="stylesheet" href="../style.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script><link rel="stylesheet" href="../prettify.css" type="text/css"><!-- link(rel: 'stylesheet', href: req.baseURL + '/css/ext4.css', type: 'text/css')--><link rel="shortcut icon" type="image/ico" href="../favicon.ico"><!--[if IE]>
+<style type="text/css">.head-band { display: none; }
+.header { border: 0; top: 0; left: 0px; background: url(../header.gif) repeat-x; }
+.doc-tab .members .member a.more { background-color: #efefef; }
+</style><link rel="stylesheet" href="/new/css/ie.css" type="text/css"><![endif]-->
+</head><body id="ext-body" class="iScroll"><div id="notice" class="notice">For up to date documentation and features, visit 
+<a href="http://docs.sencha.com/ext-js/4-0">http://docs.sencha.com/ext-js/4-0</a></div><div class="wrapper"><div class="head-band"></div><div class="header"><h2><a href="../index.html">Sencha Documentation</a></h2></div><div id="search"><form><input type="text" placeholder="Search" id="search-field" autocomplete="off" name="q"></form><div id="search-box"></div></div><div id="treePanel"></div><div id="container"><script type="text/javascript">
+
+    req = {
+        liveURL: '.',
+        standAloneMode: true,
+        origDocClass: 'Ext.util.TaskRunner',
+        docClass: 'Ext.util.TaskRunner',
+        docReq: 'Ext.util.TaskRunner',
+        version: '4.0',
+        baseURL: '.',
+        baseDocURL: '.',
+        baseProdURL: '.'
+    };
+
+    clsInfo = {};
+
+
+
+</script>
+
+<script type="text/javascript" src="../search.js"></script>
+<!--script type="text/javascript" src="/new/javascripts/app/examples.js"></script-->
+<script type="text/javascript" src="../class_tree.js"></script>
+<script type="text/javascript" src="../class_doc.js"></script>
+<script type="text/javascript">
+    req.source = 'TaskManager.html#Ext-util.TaskRunner';
+    clsInfo = {"methods":["TaskRunner","start","stop","stopAll"],"cfgs":[],"properties":[],"events":[],"subclasses":["Ext.TaskManager"]};
+    Ext.onReady(function() {
+        Ext.create('Docs.classPanel');
+    });
+</script><div id="top-block" class="top-block"><h1 id="clsTitle" class="cls"><a href="../source/TaskManager.html#Ext-util.TaskRunner" target="_blank">Ext.util.TaskRunner</a></h1></div><div id="docContent"><div id="doc-overview-content"><div class="lft"><p>Provides the ability to execute one or more arbitrary tasks in a multithreaded
+manner.  Generally, you can use the singleton <a href="Ext.TaskManager.html" rel="Ext.TaskManager" class="docClass">Ext.TaskManager</a> 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:</p>
+
+<pre class="prettyprint"><code>// Start a simple clock task that updates a div once per second
+var updateClock = function(){
+    Ext.fly('clock').update(new Date().format('g:i:s A'));
+} 
+var task = {
+    run: updateClock,
+    interval: 1000 //1 second
+}
+var runner = new Ext.util.TaskRunner();
+runner.start(task);
+
+// equivalent using TaskManager
+Ext.TaskManager.start({
+    run: updateClock,
+    interval: 1000
+});
+
+</code></pre>
+
+
+<p>See the <a href="Ext.util.TaskRunner.html#start" rel="Ext.util.TaskRunner#start" class="docClass">start</a> method for details about how to configure a task object.</p>
+
+
+<p>Also see <a href="Ext.util.DelayedTask.html" rel="Ext.util.DelayedTask" class="docClass">Ext.util.DelayedTask</a>.</p>
+<div class="members"><div class="m-methods"><a name="methods"></a><div class="definedBy">Defined By</div><h3 class="mth p">Methods</h3><div id="method-TaskRunner" class="member f ni"><a href="Ext.util.TaskRunner.html#method-TaskRunner" rel="method-TaskRunner" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.TaskRunner.html" class="definedIn docClass">Ext.util.TaskRunner</a><br/><a href="../source/TaskManager.html#Ext-util.TaskRunner-method-constructor" class="viewSource">view source</a></div><a name="TaskRunner"></a><a name="method-TaskRunner"></a><a href="Ext.util.TaskRunner.html#" rel="method-TaskRunner" class="cls expand">TaskRunner</a>(
+<span class="pre">[Number interval]</span>)
+ : void</div><div class="description"><div class="short"><p>&nbsp;</p></div><div class="long">
+<h3 class="pa">Parameters</h3><ul><li><span class="pre">interval</span> : Number<div class="sub-desc"><p>(optional) The minimum precision in milliseconds supported by this TaskRunner instance
+(defaults to 10)</p>
+</div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
+</li></ul></div></div></div><div id="method-start" class="member ni"><a href="Ext.util.TaskRunner.html#method-start" rel="method-start" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.TaskRunner.html" class="definedIn docClass">Ext.util.TaskRunner</a><br/><a href="../source/TaskManager.html#Ext-util.TaskRunner-method-start" class="viewSource">view source</a></div><a name="start"></a><a name="method-start"></a><a href="Ext.util.TaskRunner.html#" rel="method-start" class="cls expand">start</a>(
+<span class="pre">[Object task]</span>)
+ : Object</div><div class="description"><div class="short"><p>Starts a new task.</p>
+</div><div class="long"><p>Starts a new task.</p>
+<h3 class="pa">Parameters</h3><ul><li><span class="pre">task</span> : Object<div class="sub-desc"><p>A config object that supports the following properties:<ul>
+<li><code>run</code> : Function<div class="sub-desc"><p>The function to execute each time the task is invoked. The
+function will be called at each interval and passed the <code>args</code> argument if specified, and the
+current invocation count if not.</p>
+<p>If a particular scope (<code>this</code> reference) is required, be sure to specify it using the <code>scope</code> argument.</p>
+<p>Return <code>false</code> from this function to terminate the task.</p></div></li>
+<li><code>interval</code> : Number<div class="sub-desc">The frequency in milliseconds with which the task
+should be invoked.</div></li>
+<li><code>args</code> : Array<div class="sub-desc">(optional) An array of arguments to be passed to the function
+specified by <code>run</code>. If not specified, the current invocation count is passed.</div></li>
+<li><code>scope</code> : Object<div class="sub-desc">(optional) The scope (<tt>this</tt> reference) in which to execute the
+<code>run</code> function. Defaults to the task config object.</div></li>
+<li><code>duration</code> : Number<div class="sub-desc">(optional) The length of time in milliseconds to invoke
+the task before stopping automatically (defaults to indefinite).</div></li>
+<li><code>repeat</code> : Number<div class="sub-desc">(optional) The number of times to invoke the task before
+stopping automatically (defaults to indefinite).</div></li>
+</ul></p>
+
+
+<p>Before each invocation, <a href="Ext.html" rel="Ext" class="docClass">Ext</a> injects the property <code>taskRunCount</code> into the task object so
+that calculations based on the repeat count can be performed.</p>
+
+</div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">Object</span>&nbsp; &nbsp;<p>The task</p>
+</li></ul></div></div></div><div id="method-stop" class="member ni"><a href="Ext.util.TaskRunner.html#method-stop" rel="method-stop" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.TaskRunner.html" class="definedIn docClass">Ext.util.TaskRunner</a><br/><a href="../source/TaskManager.html#Ext-util.TaskRunner-method-stop" class="viewSource">view source</a></div><a name="stop"></a><a name="method-stop"></a><a href="Ext.util.TaskRunner.html#" rel="method-stop" class="cls expand">stop</a>(
+<span class="pre">Object task</span>)
+ : Object</div><div class="description"><div class="short"><p>Stops an existing running task.</p>
+</div><div class="long"><p>Stops an existing running task.</p>
+<h3 class="pa">Parameters</h3><ul><li><span class="pre">task</span> : Object<div class="sub-desc"><p>The task to stop</p>
+</div></li></ul><h3 class="pa">Returns</h3><ul><li><span class="pre">Object</span>&nbsp; &nbsp;<p>The task</p>
+</li></ul></div></div></div><div id="method-stopAll" class="member ni"><a href="Ext.util.TaskRunner.html#method-stopAll" rel="method-stopAll" class="expand more ar"><span>&nbsp;</span></a><div class="title"><div class="meta"><a href="Ext.util.TaskRunner.html" class="definedIn docClass">Ext.util.TaskRunner</a><br/><a href="../source/TaskManager.html#Ext-util.TaskRunner-method-stopAll" class="viewSource">view source</a></div><a name="stopAll"></a><a name="method-stopAll"></a><a href="Ext.util.TaskRunner.html#" rel="method-stopAll" class="cls expand">stopAll</a> : void</div><div class="description"><div class="short"><p>Stops all tasks that are currently running.</p>
+</div><div class="long"><p>Stops all tasks that are currently running.</p>
+<h3 class="pa">Returns</h3><ul><li><span class="pre">void</span>&nbsp; &nbsp;
+</li></ul></div></div></div></div></div></div></div><div id="pageContent"></div></div></div></div></body></html>
\ No newline at end of file