Common tools and functions of extjs4-Ext. util. taskrunner

Source: Internet
Author: User

The enhanced version of delayedtask can provide multi-threaded timing services. This class provides management of multi-threaded tasks. You can use exttaskmgr to create an instance of taskrunner, and you can also create Ext on your own. util. taskrunner instance.

 
 

 
VaR task = {run: function () {Ext. Fly ('Clock'). Update (NewDate (). Format ('G: I: s');}, Interval: 1000// (Unit: milliseconds)} Var runner =NewExt. util. taskrunner (); runner. Start (task );

Structure:

Taskrunner ([number interval])

Interval: an optional parameter. When creating a scheduled task, you can specify interval in milliseconds as the interval for executing the thread. If this parameter is not specified, the default value is 10 milliseconds.

Method:

Start a thread: Start ([object task]): Object

Task: an optional parameter. It is an object.

Returns the object of the execution thread.

Stop a thread: Stop ([object task]): Object

Stop an existing task and return the task object.

Stop all threads: stopall ();

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.