• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Push events from Server to client - when and how

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I guess this is more of a design question than a programming one but is related to servlets...

In our application, Javawebstart GUI - Servlet (Jetty), our server sends a lot of 'events' to keep the GUI uptodate of the changes at the backend. Events are nothing but XML messages containing objects translated to XML sent out as http chunks asynchronoulsy.
Now since our application has grown we have 100 and 1000s of these events flooding the GUI.
I was wondering how people handle the following,
1. How do you keep clients updated with asynchronous changes caused due to other interfaces or other threads on the server.
2. When a cilent request comes in and you want to return immediately since the operation reqesut is time-consuming you spawn a thread from the reques thread and let the request thread complete. How do you later detemine how to and when to update the client with what has changed. Is there a standard way of doign it..like some design pattern, strategies etc.
3. Events in our case are thrown at several levels - one level directly below the servlet or serveral levels below it. If a call comes from servlet I dont want my lower layers to throw event, my servlet shall do it. But call to lowerlayers can come from places other than a servlet like seperate threads in the app etc. Is there a standard way or popular way of differentiating such calls.

Thanks in advance.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"anotherdeveloper fromothermother",please check your private messages for an important administrative matter.
 
reply
    Bookmark Topic Watch Topic
  • New Topic