0

[ZK 6.5.0 CE] POST events are fired every second when EventQueue & async handler is used

asked 2012-10-12 12:35:31 +0800

bratislav1983 gravatar image bratislav1983
54 1

updated 2012-10-12 12:39:51 +0800

Hi ZK gurus,

I'm trying to run a long operation in a async handler using a EventQueue class and guides from this article
Article.
Here is the snippet of my code :

public void doAfterCompose(Tabpanel comp) throws Exception {
		
super.doAfterCompose(comp);

EventQueue<Event> eq = EventQueues.lookup("initop", EventQueues.APPLICATION, true); // create a queue
...
eq.subscribe(
    new EventListener<Event>() {
        public void onEvent(Event evt) { // asynchronous
					
	    // ok, we do init asynchronously

	   Logger.info("Initializing MainWindow...");

            // init calls are here
            ...

}}, true);

eq.publish(new Event("whatever")); // start init operation in the background

}

That's working fine, but here is the problem : when I try to run this example on iPad2, busy icon will spin non-stop in the
header menu of the Safari browser. Opening this page in a Chrome developer console (F12), Network tab shows that there
are some POST packets constantly send like every second.

Check this out :

Why is this happening? Some browsers won't show busy icon (like Chrome on iPad) and some will (Safari), but these small packets are always sent. Same thing when I run the example from the article above.

delete flag offensive retag edit

2 Replies

Sort by ยป oldest newest

answered 2012-10-12 12:44:00 +0800

gekkio gravatar image gekkio flag of Finland
899 1
http://gekkio.fi/blog

ZK CE supports only polling server push, so you will see a large number of requests and there will always be some latency in the events. Your choices are:
1. Buy PE or EE, which use Comet-based server push implementations (EE is the best, because it can use Servlet 3.0 async API)
2. Adjust the polling timeout
3. Use my Atmosphere server push implementation

link publish delete flag offensive edit

answered 2012-10-12 14:34:34 +0800

bratislav1983 gravatar image bratislav1983
54 1

Awesome gekkio, thanx a million! Will try your library later.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2012-10-12 12:35:31 +0800

Seen: 100 times

Last updated: Oct 12 '12

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More