• 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

Getting informations using Ajax only when they are available

 
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi.
Assume that I want to employ Ajax in my auction web application.
As you might have guessed, Ajax is used here to get the highest bid <b>when it is available</b>.
Using a timer in the client is not solution, I think.
Maybe no new bid is available, running the Ajax code in this case at fixed intervals is useless and resource hungry.
How to send notifications to the client when a new bid is available ?
(Well, forget about sending notifications , how to implement this functionality ?)
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
John,
HTTP is a request-response protocol. Since AJAX is implemented on top of HTTP, it has the same limitation. This means that the server can't inform the client that something has changed.

AJAX is better than doing full page loads on each refresh though. The page can be smart enough not to repaint anything. And the server can cache the result to minimize the resource usage.
 
Hussein Baghdadi
clojure forum advocate
Posts: 3479
Mac Objective C Clojure
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is a new library called Reversed Ajax (the server is supposed to send asynchronous messages to the client).
So, any tips how to implement my requirements ?
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are going to overload your server with push technology using Ajax. You basically make a request and keep it open until the server detects something different. Called COMET.

If you want to have a socket connection, you need to use FLEX 2.0 or Applets.

Eric
 
Goodbye moon men. Hello tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic