Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Global notification method

 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,
I'm doing a Grails application, this application is for sending bulk SMSs.
Sending SMS doesn't happening immediately, a JMS message is sent to MOM and a listener then does the dirty work.
So the user clicks on the button (via Ajax), he gets an info message and he is free to use the rest of the application.
I want to show him a global notification info label when the JMS listener is done with sending.
Do you suggest a way to do this?
If it isn't practical, do you know a better way?
(Sorry if this is not the right forum to ask).
Thanks for help and time.
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well the server can not push data back to the client so the client has to keep asking for it. So you either ping the server on regular intervals, or you use COMET.

Eric
 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ajax Comet is something new to me.
Do you know an easy to read article about it?
I'm using Prototype, is it possible to comet with Prototype?
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In your case COMET is probably overkill.

All COMET is is making an Ajax call to the server, and the server holds it open until it needs to send data back. Most places can not handle that many open connections at one time.

Just send up a ping to the server asking if it has anything new.

Eric
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In our app we're doing something similar (not SMS) but we're sending messages to a JMS queue and our app just sends an ajax request to the server to check the status of things, periodically. I looked into COMET and ran away.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic