-
FEATURED COMPONENTS
First time here? Check out the FAQ!
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.
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
Awesome gekkio, thanx a million! Will try your library later.
Asked: 2012-10-12 12:35:31 +0800
Seen: 100 times
Last updated: Oct 12 '12