Example usage for com.vaadin.client.communication ServerRpcQueue isFlushPending

List of usage examples for com.vaadin.client.communication ServerRpcQueue isFlushPending

Introduction

In this page you can find the example usage for com.vaadin.client.communication ServerRpcQueue isFlushPending.

Prototype

public boolean isFlushPending() 

Source Link

Document

Checks if a flush operation is pending.

Usage

From source file:com.haulmont.cuba.web.toolkit.ui.client.timer.CubaTimerConnector.java

License:Apache License

public void onTimer() {
    if (running) {
        if (getState().listeners) {
            ServerRpcQueue rpcQueue = getConnection().getServerRpcQueue();

            if (rpcQueue.isEmpty() || !rpcQueue.isFlushPending()) {
                // if application stopped we will not schedule new timer event
                if (getConnection().isApplicationRunning()) {
                    rpc.onTimer();//from ww  w.  ja  v a2 s.  co  m
                }
            } else {
                jsTimer.schedule(DEFFERED_DELAY_MS);
            }
        } else {
            requestCompleted();
        }
    }
}