Example usage for com.google.gwt.core.client Scheduler scheduleFinally

List of usage examples for com.google.gwt.core.client Scheduler scheduleFinally

Introduction

In this page you can find the example usage for com.google.gwt.core.client Scheduler scheduleFinally.

Prototype

public abstract void scheduleFinally(ScheduledCommand cmd);

Source Link

Document

A "finally" command will be executed before GWT-generated code returns control to the browser's event loop.

Usage

From source file:org.activityinfo.legacy.client.remote.MergingDispatcher.java

License:Open Source License

public MergingDispatcher(Dispatcher dispatcher, Scheduler scheduler, BackOff backOff) {
    this.dispatcher = dispatcher;
    this.scheduler = scheduler;
    this.backOff = backOff;

    scheduler.scheduleFinally(new RepeatingCommand() {

        @Override//w  w  w.  ja  va2 s  . co m
        public boolean execute() {
            try {
                if (!pendingCommands.isEmpty()) {
                    dispatchPending();
                }
            } catch (Exception e) {
                Log.error("Uncaught exception while dispatching in MergingDispatcher", e);
            }
            return true;
        }
    });
}