GWT scheduleFixedDelay method is not working when browser window is minimized

Published

GWT scheduleFixedDelay method is not executed when the browser window is minimized. Due to the browser restricting the timer throttling.

If the set the below values in the browser It is working. But I want code to work.

dom.min_background_timeout_value_without_budget_throttling = 0 (changed from 1000)
dom.timeout.enable_budget_timer_throttling = false

Is there any other way to solve this in the GWT code ?

private void scheduleEventProcessor(){
        if(isSchedulerActive){
            return;
        }
        isSchedulerActive = true;
        
        Scheduler.get().scheduleFixedDelay(new RepeatingCommand() {
            
            @Override
            public boolean execute() {
                for(int i=0; eventDataQueue.size()>0 && i<5; i++){
                    BaseData cometData = eventDataQueue.removeFirst();
                    if(cometData != null){
                        ArrayList<IClientEventListener> features = registry.getListeners(cometData.getKey());
                        if (features != null) {
                            for (IClientEventListener feature : features) {
                                try {
                                    feature.update(cometData);
                                } catch (Exception e) {
                                    e.printStackTrace();
                                    if(feature != null){
                                        ClientUtil.logErrorOnConsole("Exception while trying to update feature : " + feature.getName());
                                    }
                                }
                            }
                        }
                    }
                    
                }
                isSchedulerActive = (eventDataQueue.size() > 0);
                return isSchedulerActive;
            }
        }, 5);

    }


Source: AngularJS Questions

Published
Categorized as angularjs, gwt, javascript, smartgwt Tagged , , ,

Answers

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Still Have Questions?


Our dedicated development team is here for you!

We can help you find answers to your question for as low as 5$.

Contact Us
faq