On Nov 26, 2010, at 9:15 AM, Iain Simpson wrote:
> I'd wondered how callAfterInterval worked !
It serves two main functions: one, to allow a delay before a method
gets called, such as in this case. But it also helps prevent multiple calls to
the same thing: a common case are calls to refresh() or layout(), which really
only need to be called once after everything is done processing. The way
callAfterInterval() (and its property-based counterpart, setAfterInterval)
works is it queues the call and starts a timer; when the timer expires, the
call is made. However, if another callAfterInterval() for the same method is
received before the timer fires, it simply resets the timer. So a thousand
calls to refresh() may be made, but if they all come within the timer's
interval, only one call ever gets made. This has been a huge performance boost
in the dabo ui code.
Hmm... I just wrote that, and then realized that the same info is on
the wiki: http://wiki.dabodev.com/DaboUiCallAfterInterval and
http://wiki.dabodev.com/DaboUiSetAfterInterval
-- Ed Leafe
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message:
http://leafe.com/archives/byMID/[email protected]