Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>JavaScript (in a browser) is single threaded. The event loop model means, we're always in exactly one of two states:</p> <ul> <li>in the event loop</li> <li>executing an event handler</li> </ul> <p>There are many kinds of events: Click events, onload events, XHR events, timer events, ... You'll have to declare some handlers (at least one during page load), otherwise none of your code will ever be executed. One of them is the handler you specify by implementing <code>onModuleLoad</code>.</p> <p>It's important to keep all handlers short, because there's no parallelism and no interrupts (except for the last resort "unresponsive script" interrupt). This means, that users can't interact with the interface, until the browser returns to the event loop - and that doesn't happen before the current handler is finished.</p> <p>So if you want to defer some code until after the other event handlers had a chance, then you can use <code>Scheduler.scheduleDeferred</code>.</p> <p><code>Scheduler.scheduleIncremental</code> helps you to split really long running tasks into multiple steps, giving the other event handlers a chance between each of the steps.</p> <p><code>Scheduler.scheduleFinally</code> just means: After handling our current handler (even if an exception occurs), but before returning to the event loop, execute my command. </p> <p>See <a href="http://grepcode.com/file/repo1.maven.org/maven2/com.google.gwt/gwt-servlet/2.1.1-rc1/com/google/gwt/core/client/impl/Impl.java#Impl.entry0%28java.lang.Object,java.lang.Object,java.lang.Object%29" rel="noreferrer">com.google.gwt.core.client.impl.Impl.entry0()</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload